elemental functions

Comments and discussion of the 4.1 OpenMP Draft specifications. Comment period ends September 30, 2015. See http://openmp.org/wp/openmp-specifications/ to download the specifications. (Read Only)
Locked
fewl9012
Posts: 73
Joined: Mon Jul 27, 2015 4:50 pm

elemental functions

Post 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?

fewl9012
Posts: 73
Joined: Mon Jul 27, 2015 4:50 pm

Re: elemental functions

Post by fewl9012 »

Also declare simd in an elemental function, no?

psxlover
Posts: 4
Joined: Mon Dec 15, 2014 2:55 am

Re: elemental functions

Post 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'.

fewl9012
Posts: 73
Joined: Mon Jul 27, 2015 4:50 pm

Re: elemental functions

Post 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.

xtian
Posts: 6
Joined: Fri Apr 05, 2013 4:55 pm

Re: elemental functions

Post by xtian »

The declare simd directive should be allowed in the pure/elemental function.

Locked