From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49058 invoked by alias); 14 Dec 2018 14:25:15 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 48942 invoked by uid 89); 14 Dec 2018 14:25:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=*devicep, devicep, locked, shut X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Dec 2018 14:25:09 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1gXoOp-0002KL-La from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Fri, 14 Dec 2018 06:25:07 -0800 Received: from hertz.schwinge.homeip.net (137.202.0.90) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 14 Dec 2018 14:25:04 +0000 From: Thomas Schwinge To: Chung-Lin Tang CC: Subject: Re: [PATCH 0/6, OpenACC, libgomp] Async re-work In-Reply-To: <432c2e58-7bf6-1f7e-457f-32813207b282@mentor.com> References: <432c2e58-7bf6-1f7e-457f-32813207b282@mentor.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/25.2.2 (x86_64-pc-linux-gnu) Date: Fri, 14 Dec 2018 14:25:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-12/txt/msg01058.txt.bz2 Hi Chung-Lin! A little bit of documentation starter update for you to include. Please make sure that all relevant functions have such comments addded. commit 7e0896281d155e1544751f43c1eaace8e005e019 Author: Thomas Schwinge Date: Thu Dec 13 17:59:46 2018 +0100 [WIP] into async re-work: documentation --- libgomp/libgomp.h | 3 +++ libgomp/oacc-async.c | 7 +++++++ libgomp/plugin/plugin-nvptx.c | 4 ++-- libgomp/target.c | 3 +++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git libgomp/libgomp.h libgomp/libgomp.h index 8b74d6368389..574fcd1ee4ad 100644 --- libgomp/libgomp.h +++ libgomp/libgomp.h @@ -949,6 +949,9 @@ typedef struct acc_dispatch_t __typeof (GOMP_OFFLOAD_openacc_exec) *exec_func; =20 struct { + /* Once created and put into the "active" list, asyncqueues are then n= ever + destructed and removed from the "active" list, other than if the TO= DO + device is shut down. */ gomp_mutex_t lock; int nasyncqueue; struct goacc_asyncqueue **asyncqueue; diff --git libgomp/oacc-async.c libgomp/oacc-async.c index b091ba2460ac..0f5f74bdf836 100644 --- libgomp/oacc-async.c +++ libgomp/oacc-async.c @@ -280,6 +280,10 @@ goacc_async_free (struct gomp_device_descr *devicep, devicep->openacc.async.queue_callback_func (aq, free, ptr); } =20 +/* This function initializes the asyncqueues for the device specified by + DEVICEP. TODO DEVICEP must be locked on entry, and remains locked on + return. */ + attribute_hidden void goacc_init_asyncqueues (struct gomp_device_descr *devicep) { @@ -289,6 +293,9 @@ goacc_init_asyncqueues (struct gomp_device_descr *devic= ep) devicep->openacc.async.active =3D NULL; } =20 +/* This function finalizes the asyncqueues for the device specified by DEV= ICEP. + TODO DEVICEP must be locked on entry, and remains locked on return. */ + attribute_hidden bool goacc_fini_asyncqueues (struct gomp_device_descr *devicep) { diff --git libgomp/plugin/plugin-nvptx.c libgomp/plugin/plugin-nvptx.c index 7b658264b8e7..577ed39ef3f6 100644 --- libgomp/plugin/plugin-nvptx.c +++ libgomp/plugin/plugin-nvptx.c @@ -1340,14 +1340,14 @@ GOMP_OFFLOAD_openacc_cuda_get_current_context (void) return nvptx_get_current_cuda_context (); } =20 -/* NOTE: This returns a CUstream, not a ptx_stream pointer. */ +/* This returns a CUstream. */ void * GOMP_OFFLOAD_openacc_cuda_get_stream (struct goacc_asyncqueue *aq) { return (void *) aq->cuda_stream; } =20 -/* NOTE: This takes a CUstream, not a ptx_stream pointer. */ +/* This takes a CUstream. */ int GOMP_OFFLOAD_openacc_cuda_set_stream (struct goacc_asyncqueue *aq, void *s= tream) { diff --git libgomp/target.c libgomp/target.c index e67d9248ae0b..96df1890a729 100644 --- libgomp/target.c +++ libgomp/target.c @@ -1506,6 +1506,9 @@ gomp_init_device (struct gomp_device_descr *devicep) devicep->state =3D GOMP_DEVICE_INITIALIZED; } =20 +/* This function finalizes the target device, specified by DEVICEP. DEVIC= EP + must be locked on entry, and remains locked on return. */ + attribute_hidden bool gomp_fini_device (struct gomp_device_descr *devicep) { Gr=C3=BC=C3=9Fe Thomas