[Bug fortran/92311] Fortran and OpenMP use_device_ptr and OpenACC attach_ptr/dettach_ptr

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Nov 2 09:21:00 GMT 2019


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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Nichols A. Romero from comment #3)
> Created attachment 47156 [details]
> OpenMP equivalent to OpenACC detach/attach

map(from:...)
means the variable is allocated, but uninitialized on the device, but you are
then reading the variables and expecting them to have meaningful values.
IMHO you want map(from:check_sign) and map(to:...) for the other variables.
Also, at least with GCC, for optimal performance when you offload to nvptx (and
would use some larger array, 100 iterations this simple certainly isn't worth
offloading), you want to use simd too, so target teams distribute parallel for
simd (or in OpenMP 5.0 just target teams loop).


More information about the Gcc-bugs mailing list