Re: nvptx: Avoid deadlock in 'cuStreamAddCallback' callback, error case (was: [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes)

2023-01-13 Thread Thomas Schwinge
Hi! On 2023-01-13T21:17:43+0800, Chung-Lin Tang wrote: > On 2023/1/12 9:51 PM, Thomas Schwinge wrote: >> In my case, 'cuda_callback_wrapper' (expectedly) gets invoked with >> 'res != CUDA_SUCCESS' ("an illegal memory access was encountered"). >> When we invoke 'GOMP_PLUGIN_fatal', this attempts t

Re: nvptx: Avoid deadlock in 'cuStreamAddCallback' callback, error case (was: [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes)

2023-01-13 Thread Chung-Lin Tang via Gcc-patches
Hi Thomas, On 2023/1/12 9:51 PM, Thomas Schwinge wrote: > In my case, 'cuda_callback_wrapper' (expectedly) gets invoked with > 'res != CUDA_SUCCESS' ("an illegal memory access was encountered"). > When we invoke 'GOMP_PLUGIN_fatal', this attempts to shut down the device > (..., which deadlocks); t

nvptx: Avoid deadlock in 'cuStreamAddCallback' callback, error case (was: [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes)

2023-01-12 Thread Thomas Schwinge
Hi Chung-Lin, Tom! It's been a while: On 2018-09-25T21:11:58+0800, Chung-Lin Tang wrote: > [...] NVPTX/CUDA-specific implementation > of the new-style goacc_asyncqueues. In an OpenACC 'async' setting, where the device kernel (expectedly) crashes because of "an illegal memory access was encounte

Re: [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes (revised, v3)

2018-12-18 Thread Chung-Lin Tang
On 2018/12/11 9:50 PM, Chung-Lin Tang wrote: On 2018/12/10 6:02 PM, Chung-Lin Tang wrote: On 2018/12/7 04:57 AM, Thomas Schwinge wrote>> ---  a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c +struct goacc_asyncqueue * +GOMP_OFFLOAD_openacc_async_construct (void) +{ +  stru

Re: [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes (revised, v2)

2018-12-11 Thread Chung-Lin Tang
On 2018/12/10 6:02 PM, Chung-Lin Tang wrote: On 2018/12/7 04:57 AM, Thomas Schwinge wrote>> --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c +struct goacc_asyncqueue * +GOMP_OFFLOAD_openacc_async_construct (void) +{ +  struct goacc_asyncqueue *aq +    = GOMP_PLUGIN_mal

Re: [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes

2018-12-10 Thread Chung-Lin Tang
On 2018/12/7 04:57 AM, Thomas Schwinge wrote>> --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c +struct goacc_asyncqueue * +GOMP_OFFLOAD_openacc_async_construct (void) +{ + struct goacc_asyncqueue *aq += GOMP_PLUGIN_malloc (sizeof (struct goacc_asyncqueue)); + aq->

Re: [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes

2018-12-06 Thread Thomas Schwinge
Hi Chung-Lin! On Tue, 25 Sep 2018 21:11:58 +0800, 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. The new code is essentially a NVPTX/CUDA-specific > implementation > of the new-style goacc_asyncque

Re: [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes

2018-10-05 Thread Tom de Vries
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 neede

[PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes

2018-09-25 Thread Chung-Lin Tang
Hi Tom, this patch removes large portions of plugin/plugin-nvptx.c, since a lot of it is now in oacc-async.c now. 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 a