[Openmp-commits] [PATCH] D62393: [OPENMP][NVPTX]Mark parallel level counter as volatile.

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Sep 24 01:49:48 PDT 2019


ABataev added a comment.

In D62393#1680242 <https://reviews.llvm.org/D62393#1680242>, @protze.joachim wrote:

> In D62393#1679250 <https://reviews.llvm.org/D62393#1679250>, @ABataev wrote:
>
> > You're wrong. My output:
> >
> >   omp_in_parallel=0
> >   omp_get_level=1
> >   omp_get_active_level=0
> >
> >
> > So, `omp_in_parallel` works correctly on GPU.
>
>
> Ok, thanks for testing. I probably didn't apply the patch correctly, then.
>
> > If it does not work correctly with `OMP_TARGET_OFFLOAD=disabled`, the problem is definitely in `libomp`, not `libomptarget`. With disabled offloading the code is not offloaded to GPU.
>
> I got above output only with host offloading, so that part also seems to be fine.
>
> After revisiting the code I understood, that the value returned by `getParallelLevel` is basically a bitfield: `struct{int active_parallel_level : 1; int parallel_level : 7;}`.


Yes, you got it!


Repository:
  rOMP OpenMP

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62393/new/

https://reviews.llvm.org/D62393





More information about the Openmp-commits mailing list