https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81896

            Bug ID: 81896
           Summary: omp target enter data not recognized
           Product: gcc
           Version: 7.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thorstenkurth at me dot com
  Target Milestone: ---

Created attachment 42005
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42005&action=edit
small test case

Dear Sir/Madam,

I am not sure if my report got posted the first time because I cannot find it
any more (did not receive a notification about it and it is also not marked
invalid somewhere).
Therefore, I will post it again.

It seems that gcc has problems with the omp target enter/exit data constructs.
When I compile the appended code I get:

g++ -O2 -std=c++11 -fopenmp -foffload=nvptx-none -c aclass.cpp -o aclass.o
In file included from aclass.h:2:0,
                 from aclass.cpp:1:
masterclass.h: In member function 'void master::allocate(const unsigned int&)':
masterclass.h:10:50: error: 'master::data' is not a variable in 'map' clause
 #pragma omp target enter data map(alloc: data[0:size*sizeof(double)])
                                          ^~~~
masterclass.h:10:9: error: '#pragma omp target enter data' must contain at
least one 'map' clause
 #pragma omp target enter data map(alloc: data[0:size*sizeof(double)])
         ^~~
masterclass.h: In member function 'void master::deallocate()':
masterclass.h:15:51: error: 'master::data' is not a variable in 'map' clause
 #pragma omp target exit data map(release: data[:0])
                                           ^~~~
masterclass.h:15:9: error: '#pragma omp target exit data' must contain at least
one 'map' clause
 #pragma omp target exit data map(release: data[:0])
         ^~~
make: *** [aclass.o] Error 1

The same code compiles fine when using XLC. 

Best Regards
Thorsten Kurth

Reply via email to