On 10/10/2017 11:08 AM, Thomas Schwinge wrote: > Reported by Cesar for a test case similar to the one below, where we > observe: > > acc_prof-cuda-1.exe: [...]/libgomp/oacc-profiling.c:592: goacc_profiling_dispatch_p: Assertion `thr->prof_info == NULL' failed. > > This is because of: > > On Tue, 25 Jul 2017 20:51:05 +0800, Chung-Lin Tang wrote: >> --- libgomp/oacc-cuda.c (revision 250497) >> +++ libgomp/oacc-cuda.c (working copy) >> @@ -99,17 +99,12 @@ acc_get_cuda_stream (int async) >> prof_info.async_queue = prof_info.async; >> } >> >> - void *ret = NULL; >> if (thr && thr->dev && thr->dev->openacc.cuda.get_stream_func) >> - ret = thr->dev->openacc.cuda.get_stream_func (async); >> - >> - if (profiling_setup_p) >> { >> - thr->prof_info = NULL; >> - thr->api_info = NULL; >> + goacc_aq aq = lookup_goacc_asyncqueue (thr, false, async); >> + return aq ? thr->dev->openacc.cuda.get_stream_func (aq) : NULL; >> } >> - >> - return ret; >> + return NULL; >> } > > Pushed to openacc-gcc-7-branch: > > commit db149741171147fa86a9bfe708a9082f508115ac > Author: Thomas Schwinge > Date: Tue Oct 10 19:25:19 2017 +0200 > > acc_get_cuda_stream: Clean up data of the OpenACC Profiling Interface > > libgomp/ > * oacc-cuda.c (acc_get_cuda_stream): Clean up data of the OpenACC > Profiling Interface. > * testsuite/libgomp.oacc-c-c++-common/acc_prof-cuda-1.c: New file. > --- > libgomp/oacc-cuda.c | 13 +++++++++++-- > .../libgomp.oacc-c-c++-common/acc_prof-cuda-1.c | 16 ++++++++++++++++ > 2 files changed, 27 insertions(+), 2 deletions(-) > > diff --git libgomp/oacc-cuda.c libgomp/oacc-cuda.c > index 1fbe77d..0ac93e9 100644 > --- libgomp/oacc-cuda.c > +++ libgomp/oacc-cuda.c > @@ -99,12 +99,21 @@ acc_get_cuda_stream (int async) > prof_info.async_queue = prof_info.async; > } > > + void *ret = NULL; > if (thr && thr->dev && thr->dev->openacc.cuda.get_stream_func) > { > goacc_aq aq = lookup_goacc_asyncqueue (thr, false, async); > - return aq ? thr->dev->openacc.cuda.get_stream_func (aq) : NULL; > + if (aq) > + ret = thr->dev->openacc.cuda.get_stream_func (aq); > } > - return NULL; > + > + if (profiling_setup_p) > + { > + thr->prof_info = NULL; > + thr->api_info = NULL; > + } > + > + return ret; > } Thanks! I wonder if it makes sense to apply my patch to og7. It's the workaround that I was using in case the async queue doesn't exist. Basically, in that case, goacc_wait turns into a nop. Cesar