public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: cltang@codesourcery.com, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes
Date: Fri, 05 Oct 2018 14:07:00 -0000	[thread overview]
Message-ID: <47ee4d62-94a0-91c4-8975-88b80bb51827@suse.de> (raw)
In-Reply-To: <9523b49a-0454-e0a9-826d-5eeec2a8c973@mentor.com>

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.

  reply	other threads:[~2018-10-05 13:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 13:13 Chung-Lin Tang
2018-10-05 14:07 ` Tom de Vries [this message]
2018-12-06 20:57 ` Thomas Schwinge
2018-12-10 10:02   ` Chung-Lin Tang
2018-12-11 13:50     ` [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes (revised, v2) Chung-Lin Tang
2018-12-18 15:07       ` [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes (revised, v3) Chung-Lin Tang
2023-01-12 13:51 ` nvptx: Avoid deadlock in 'cuStreamAddCallback' callback, error case (was: [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes) Thomas Schwinge
2023-01-13 13:17   ` Chung-Lin Tang
2023-01-13 13:59     ` Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47ee4d62-94a0-91c4-8975-88b80bb51827@suse.de \
    --to=tdevries@suse.de \
    --cc=cltang@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).