From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16630 invoked by alias); 5 Oct 2018 13:17:52 -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 16603 invoked by uid 89); 5 Oct 2018 13:17:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:4404, chung-lin, Chung-Lin, re-work X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 05 Oct 2018 13:17:49 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 71DE8AD83; Fri, 5 Oct 2018 13:17:47 +0000 (UTC) Subject: Re: [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes To: cltang@codesourcery.com, gcc-patches@gcc.gnu.org References: <9523b49a-0454-e0a9-826d-5eeec2a8c973@mentor.com> From: Tom de Vries Message-ID: <47ee4d62-94a0-91c4-8975-88b80bb51827@suse.de> Date: Fri, 05 Oct 2018 14:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <9523b49a-0454-e0a9-826d-5eeec2a8c973@mentor.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00325.txt.bz2 On 9/25/18 3:11 PM, Chung-Lin Tang wrote: > Hi Tom, > this patch removes large portions of plugin/plugin-nvptx.c, since a lot > of it is > now in oacc-async.c now. Yay! > The new code is essentially a > NVPTX/CUDA-specific implementation > of the new-style goacc_asyncqueues. > > Also, some needed functions in cuda-lib.def are added. The cuda.h > function has also > been updated to build independently without a CUDA installation. > I see these formatting issues: ... $ check_GNU_style.sh async-06.nvptx.patch There should be exactly one space between function name and parenthesis. 35:+CUresult cuStreamAddCallback(CUstream, CUstreamCallback, void *, unsigned int); Trailing operator. 1320:+ struct nvptx_thread *nvthd = ... Otherwise, OK. Thanks, - Tom > Thanks, > Chung-Lin > >     * plugin/plugin-nvptx.c (struct cuda_map): Remove. >     (struct ptx_stream): Remove. >     (struct nvptx_thread): Remove current_stream field. >     (cuda_map_create): Remove. >     (cuda_map_destroy): Remove. >     (map_init): Remove. >     (map_fini): Remove. >     (map_pop): Remove. >     (map_push): Remove. >     (struct goacc_asyncqueue): Define. >     (struct nvptx_callback): Define. >     (struct ptx_free_block): Define. >     (struct ptx_device): Remove null_stream, active_streams, async_streams, >     stream_lock, and next fields. >     (enum ptx_event_type): Remove. >     (struct ptx_event): Remove. >     (ptx_event_lock): Remove. >     (ptx_events): Remove. >     (init_streams_for_device): Remove. >     (fini_streams_for_device): Remove. >     (select_stream_for_async): Remove. >     (nvptx_init): Remove ptx_events and ptx_event_lock references. >     (nvptx_attach_host_thread_to_device): Remove CUDA_ERROR_NOT_PERMITTED >     case. >     (nvptx_open_device): Add free_blocks initialization, remove >     init_streams_for_device call. >     (nvptx_close_device): Remove fini_streams_for_device call, add >     free_blocks destruct code. >     (event_gc): Remove. >     (event_add): Remove. >     (nvptx_exec): Adjust parameters and code. >     (nvptx_free): Likewise. >     (nvptx_host2dev): Remove. >     (nvptx_dev2host): Remove. >     (nvptx_set_async): Remove. >     (nvptx_async_test): Remove. >     (nvptx_async_test_all): Remove. >     (nvptx_wait): Remove. >     (nvptx_wait_async): Remove. >     (nvptx_wait_all): Remove. >     (nvptx_wait_all_async): Remove. >     (nvptx_get_cuda_stream): Remove. >     (nvptx_set_cuda_stream): Remove. >     (GOMP_OFFLOAD_alloc): Adjust code. >     (GOMP_OFFLOAD_free): Likewise. >     (GOMP_OFFLOAD_openacc_register_async_cleanup): Remove. >     (GOMP_OFFLOAD_openacc_exec): Adjust parameters and code. >     (GOMP_OFFLOAD_openacc_async_test_all): Remove. >     (GOMP_OFFLOAD_openacc_async_wait): Remove. >     (GOMP_OFFLOAD_openacc_async_wait_async): Remove. >     (GOMP_OFFLOAD_openacc_async_wait_all): Remove. >     (GOMP_OFFLOAD_openacc_async_wait_all_async): Remove. >     (GOMP_OFFLOAD_openacc_async_set_async): Remove. >     (cuda_free_argmem): New function. >     (GOMP_OFFLOAD_openacc_async_exec): New plugin hook function. >     (GOMP_OFFLOAD_openacc_create_thread_data): Adjust code. >     (GOMP_OFFLOAD_openacc_cuda_get_stream): Adjust code. >     (GOMP_OFFLOAD_openacc_cuda_set_stream): Adjust code. >     (GOMP_OFFLOAD_openacc_async_construct): New plugin hook function. >     (GOMP_OFFLOAD_openacc_async_destruct): New plugin hook function. >     (GOMP_OFFLOAD_openacc_async_test): Remove and re-implement. >     (GOMP_OFFLOAD_openacc_async_synchronize): New plugin hook function. >     (GOMP_OFFLOAD_openacc_async_serialize): New plugin hook function. >     (GOMP_OFFLOAD_openacc_async_queue_callback): New plugin hook function. >     (cuda_callback_wrapper): New function. >     (cuda_memcpy_sanity_check): New function. >     (GOMP_OFFLOAD_host2dev): Remove and re-implement. >     (GOMP_OFFLOAD_dev2host): Remove and re-implement. >     (GOMP_OFFLOAD_openacc_async_host2dev): New plugin hook function. >     (GOMP_OFFLOAD_openacc_async_dev2host): New plugin hook function.