This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81896] New: omp target enter data not recognized
- From: "thorstenkurth at me dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 18 Aug 2017 19:34:00 +0000
- Subject: [Bug c++/81896] New: omp target enter data not recognized
- Auto-submitted: auto-generated
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