The curren nvfortran compiler (nvfortran 22.1-0 64-bit target on x86-64 Linux -tp skylake-avx512) does not allow omp simd
declaration within pure
subroutines, although this is explicitely allowed by the openmp standard (5.1 probably also earlier versions):
OpenMP directives, except simd and declarative directives, may not appear in pure procedures.
The following code:
module testmod
implicit none
contains
pure subroutine fillup(array)
integer, intent(out) :: array(:)
integer :: ii
!$omp simd
do ii = 1, size(array)
array(ii) = 2 * ii
end do
end subroutine fillup
end module testmod
triggers the compiler error mesage
NVFORTRAN-S-0155-fillup - PURE subprograms may not contain OpenMP directives (/home/aradi/omp.f90: 12)
0 inform, 0 warnings, 1 severes, 0 fatal for fillup
when compiled with
nvfortran -c -mp ~/omp.f90