Gfortran offloading reduction error
Patrick Begou
Patrick.Begou@univ-grenoble-alpes.fr
Wed Sep 24 10:32:42 GMT 2025
Hi,
I'm testing some OpenMP offloading behavior and gfortran 15.2 raise a
bad behaviour with this small piece of code.
The code tests an array of a simple user defined type with 2 arrays (a
vector of 3 elements and a matrix of 3x3 elements). The arrays sizes are
known at compile time.
An array of 10 element is built, values are intialized then they are
checked on host and on device.
The code works with Nvidia (nvhpc/24.3 on A100 and nvhpc/25.5 on T600),
Cray Fortran (cce18 on Mi250) or the AMD compiler (on Mi250) but not
with GCC 15.2 on Nvidia T600 nor with the old GCC OG13 on Nvidia A100 GPU .
In the provided code the reductions (kernels lines 100 or 107) seams to
always return .true. with gfortran. Changing the tested value (removing
the minus sign for exemple) do no change the code behaviour.
Built with:
gfortran -c -fopenmp -cpp begou_omp_array_of_types.f90
gfortran begou_omp_array_of_types.o -fopenmp -cpp -o
begou_omp_array_of_types.exe
execution shows always:
on cpu OK
on gpu OK
Element xx is valid
Patrick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: begou_omp_array_of_types.f90
Type: text/x-fortran
Size: 3719 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20250924/db466fc9/attachment.bin>
More information about the Fortran
mailing list