page 26: OpenMP directives may not appear in PURE or ELEMENTAL procedures.
Why not?
More importantly, it would seem important to at least allow 'declare target' directives in pure and elemental procedures, or else how would they get compiled for the target device?
elemental functions
Re: elemental functions
Also declare simd in an elemental function, no?
Re: elemental functions
I have no idea how the fortran declare target works, but that line says that no OpenMP directives can appear in PURE and ELEMENTAL procedures, not the other way around, PURE and ELEMENTAL procedures can appear in the OpenMP directive 'declare target'.
Re: elemental functions
Clearly you are not a Fortran programmer. In Fortran, the !$omp declare target would appear within the subprogram to which it applies. Fortran, unlike C/C++, doesn't have the concept of a file or file scope, so there is no way to say 'declare target' from here in the file to some 'end declare target' later in the file that spans procedures.
Re: elemental functions
The declare simd directive should be allowed in the pure/elemental function.