Hi,
I report that a triple loop containing the Fortran built-in function sum
runs fine when compiled with NVFORTRAN with OpenACC enabled, but not when OpenMP is enabled.
The following sample program (sum_test.f90) contains the triple loop that does not run when compiled with only OpenMP enabled, but runs fine when only OpenACC is enabled.
program sum_test
implicit none
integer,parameter :: max_array=100, &
max_loop=100
integer :: i,j,k
real(8) :: a(max_array),b
integer :: jsta,jend,ksta,kend
jsta=1
jend=100
ksta=1
kend=100
a=1.d0
b=0.d0
!$acc kernels loop collapse(3) reduction(+:b)
!$omp target teams loop reduction(+:b) collapse(3)&
!$omp defaultmap(tofrom:scalar)
do i=1,max_loop
do j=jsta,jend
do k=ksta,kend
b = b + sum( a )
enddo
enddo
enddo
!$acc end kernels loop
!$omp end target teams loop
write(6,*) b
end program sum_test
This compilation was done with
nvfortran -mp=gpu sum_test.f90
. The NVIDIA HPC SDK versions I tried in this compilation are 22.11 and 23.11. The compilation succeeds, but the computation does not complete without error messages.
Please let me know if you notice anything.
Thank you in advance.