From patchwork Fri May 22 22:16:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 1296482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49TLZV0bdqz9sPK for ; Sat, 23 May 2020 08:22:09 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A018E388B02E; Fri, 22 May 2020 22:21:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 42465386F824 for ; Fri, 22 May 2020 22:21:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 42465386F824 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Julian_Brown@mentor.com IronPort-SDR: bUFty+3hRDWJPh4pd/EXT3roi1YW83LzeSochZ0qPitkJvPn6+OCm7Dhfx+tqQWTCRzwg3lRaq mrEbA5bHpu9/asg9iHm8Kh4Hqm1ViUDkPFLpzFgG35TDzS/c39bEZpfkJoctGhwhRDiKRQP3ix bWFtXYhEu8ETq6cLRQ4MZApH5xxbDe0z27pAaqxwvahAFtQ8GiSz5hAsIqB/w6qJKW/22KkIDg ddjOKa7qjleX9m7ClqspWtKfM//xSXYiaKuWJRc2BwctyENN6SyqxmzdUDk9fvx/dyUwV+JdQ/ Nic= X-IronPort-AV: E=Sophos;i="5.73,423,1583222400"; d="scan'208";a="49127038" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 22 May 2020 14:21:28 -0800 IronPort-SDR: as6Ski29x4X0DOcxzAO8VrlYxOwPhECeucFm1N5z7aS7npBNyyp/+ZrHow93eETzaLKEf9VqMP CuAv8vF5pFsLTdIGPWUJ8M2o56UwplLWhid5kG4hSg36pj8SnqI/D82SHprihdHUreRkD6/wUv BlAhvEThhr6med3+4ZQ40hkjM7CRApxL0Whk+PA7ILcj6iIJ1YlOAHQQTQSrqX6ir7JZ8BsOD0 g/mJol/PRWK0V5lHFw2331JUqxcovztN6kUWJU2Q0o2JTsw063I037sJUQq9eLVm/hx2kKEwJy GJw= From: Julian Brown To: Subject: [PATCH 3/7] [OpenACC] Don't pass kind array via pointer to goacc_enter_datum Date: Fri, 22 May 2020 15:16:06 -0700 Message-ID: <93a8c26ad510454f6326705ecb20f99fd8582ca5.1590182783.git.julian@codesourcery.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catherine_Moore@mentor.com, jakub@redhat.com, thomas@codesourcery.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Since goacc_enter_datum only maps a single data item now, there is no need to pass "kinds" as an array. Passing as a scalar allows for some simplification in the function's callers. OK? Julian ChangeLog libgomp/ * oacc-mem.c (goacc_enter_datum): Use scalar kind argument instead of kinds array. (acc_create, acc_create_async, acc_copyin, acc_copyin_async): Update calls to goacc_enter_datum. --- libgomp/oacc-mem.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/libgomp/oacc-mem.c b/libgomp/oacc-mem.c index fff0d573f59..20d241382a8 100644 --- a/libgomp/oacc-mem.c +++ b/libgomp/oacc-mem.c @@ -501,7 +501,8 @@ acc_unmap_data (void *h) /* Enter dynamic mapping for a single datum. Return the device pointer. */ static void * -goacc_enter_datum (void **hostaddrs, size_t *sizes, void *kinds, int async) +goacc_enter_datum (void **hostaddrs, size_t *sizes, unsigned short kind, + int async) { void *d; splay_tree_key n; @@ -560,7 +561,7 @@ goacc_enter_datum (void **hostaddrs, size_t *sizes, void *kinds, int async) struct target_mem_desc *tgt = gomp_map_vars_async (acc_dev, aq, mapnum, hostaddrs, NULL, sizes, - kinds, true, GOMP_MAP_VARS_ENTER_DATA); + &kind, true, GOMP_MAP_VARS_ENTER_DATA); assert (tgt); assert (tgt->list_count == 1); n = tgt->list[0].key; @@ -584,15 +585,13 @@ goacc_enter_datum (void **hostaddrs, size_t *sizes, void *kinds, int async) void * acc_create (void *h, size_t s) { - unsigned short kinds[1] = { GOMP_MAP_ALLOC }; - return goacc_enter_datum (&h, &s, &kinds, acc_async_sync); + return goacc_enter_datum (&h, &s, GOMP_MAP_ALLOC, acc_async_sync); } void acc_create_async (void *h, size_t s, int async) { - unsigned short kinds[1] = { GOMP_MAP_ALLOC }; - goacc_enter_datum (&h, &s, &kinds, async); + goacc_enter_datum (&h, &s, GOMP_MAP_ALLOC, async); } /* acc_present_or_create used to be what acc_create is now. */ @@ -617,15 +616,13 @@ acc_pcreate (void *h, size_t s) void * acc_copyin (void *h, size_t s) { - unsigned short kinds[1] = { GOMP_MAP_TO }; - return goacc_enter_datum (&h, &s, &kinds, acc_async_sync); + return goacc_enter_datum (&h, &s, GOMP_MAP_TO, acc_async_sync); } void acc_copyin_async (void *h, size_t s, int async) { - unsigned short kinds[1] = { GOMP_MAP_TO }; - goacc_enter_datum (&h, &s, &kinds, async); + goacc_enter_datum (&h, &s, GOMP_MAP_TO, async); } /* acc_present_or_copyin used to be what acc_copyin is now. */