Page 1 of 1

elemental functions

PostPosted: Tue Jul 28, 2015 6:38 pm
by fewl9012
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?

Re: elemental functions

PostPosted: Tue Jul 28, 2015 6:43 pm
by fewl9012
Also declare simd in an elemental function, no?

Re: elemental functions

PostPosted: Mon Aug 31, 2015 1:46 am
by psxlover
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

PostPosted: Mon Aug 31, 2015 2:35 pm
by fewl9012
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

PostPosted: Tue Sep 01, 2015 11:16 am
by xtian
The declare simd directive should be allowed in the pure/elemental function.