[Openmp-dev] Libomptarget fatal error 1: '#pragma omp requires unified_shared_memory' not used consistently!

Itaru Kitayama via Openmp-dev openmp-dev at lists.llvm.org
Sat Feb 27 17:28:24 PST 2021


I'm trying to build a test C++ code that uses part of
unified_shared_memory/shared_update.c

On Sun, Feb 28, 2021 at 10:25 AM Johannes Doerfert
<johannesdoerfert at gmail.com> wrote:
>
> I don't see this test, nor do I understand what you are trying to say.
> Is the test failing? If so, which test is this?
>
> ~ Johannes
>
>
> On 2/27/21 7:17 PM, Itaru Kitayama via Openmp-dev wrote:
> > The below C++ code builds, but the executable fails at runtime.
> > (It is taken from the C code under the libomptarget subdir's test directory)
> >
> > #include <omp.h>
> >
> > #pragma omp requires unified_shared_memory
> > #define N 1024
> > extern "C" void __tgt_register_requires(int64_t);
> >
> > int main() {
> >
> >    int a[N] = {0};
> >    int b[N] = {0};
> >    int *device_data;
> >    __tgt_register_requires(1);
> > #pragma omp target map(tofrom : device_data)
> >    {
> >      device_data = &a[0];
> >      for (int i = 0; i < 1024; i++) {
> >        a[i] += 1;
> >      }
> >    }
> > }
> > _______________________________________________
> > Openmp-dev mailing list
> > Openmp-dev at lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev


More information about the Openmp-dev mailing list