https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120753
Benjamin Schulz <schulz.benjamin at googlemail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |--- Status|RESOLVED |UNCONFIRMED --- Comment #8 from Benjamin Schulz <schulz.benjamin at googlemail dot com> --- Hi tobias, The standard says: Unless otherwise specified, a variable that is part of an aggregate variable must not be a variable list item or an extended list item except C++ has no lists. That entire comment does not apply here.. But a member of a struct like struct myarray { double *data; double *extents; } myarray t; t.data here is just a variable that is part of an aggregate variable and thus allowed. The clauses in the mappings are exactly the same. but the map macros will accept something like map (to: u.t[0:20]) because u.t is just an aggregate type... The workaround: double *tmp = u.t; #pragma omp target is_device_ptr(tmp) tmp[i] = 20; makes not much sense, since that will mean that one can not use the struct within the loop but just needs to unpack it before into several variables... whereas something like this would work: #pragma omp target enter data map(alloc:u.t[0:20]) #pragma omp target teams distribute for(int i=1;i<20;i++) { u.t[i]=20; } But the problem is that this needs that the space is allocated on the host. When you want to create a temporary matrix that is just on gpu, the map macros are not an option, because assume i want to create a struct on gpu, that contains 16 gigabyte. The mapping macros would need that i allocate then this memory on the host before I map them.