https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82475
Bug ID: 82475
Summary: GCC is unable to compile OpenACC with class fields
Product: gcc
Version: 7.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: marcin.marcin.m at gmail dot com
Target Milestone: ---
Created attachment 42323
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42323&action=edit
test.cpp - the source code which triggers the bug
When trying to compile the attached code, g++ 7.2.0 bails out with
$ g++ -fopenacc test.cpp
test.cpp: In constructor ‘foo::foo(float*, size_t)’:
test.cpp:7:42: error: ‘foo::_x’ is not a variable in ‘map’ clause
#pragma acc enter data copyin(_x)
^
test.cpp:7:17: error: ‘#pragma acc enter data’ has no data movement clause
#pragma acc enter data copyin(_x)
^~~
The code is properly compiled using PGI Professional 17.9
$ pgc++ -acc -ta=tesla:cc60 -Minfo=accel test.cpp -o test
foo::foo(float *, unsigned long):
8, Generating enter data copyin(_x[:])
The OpenACC 2.5 Programming and Best Practice Guide, [1] page 32, clearly shows
that copying in member variables should be supported
System: Arch Linux
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc-multilib/src/gcc/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu
--disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object
--enable-linker-build-id --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu
--enable-gnu-indirect-function --enable-multilib --disable-werror
--enable-checking=release --enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 7.2.0 (GCC)
[1]
https://www.openacc.org/sites/default/files/inline-files/OpenACC_Programming_Guide_0.pdf