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)

elemental functions

Postby fewl9012 » Tue Jul 28, 2015 6:38 pm

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: 67
Joined: Mon Jul 27, 2015 4:50 pm

Re: elemental functions

Postby fewl9012 » Tue Jul 28, 2015 6:43 pm

Also declare simd in an elemental function, no?
fewl9012
 
Posts: 67
Joined: Mon Jul 27, 2015 4:50 pm

Re: elemental functions

Postby psxlover » Mon Aug 31, 2015 1:46 am

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'.
psxlover
 
Posts: 4
Joined: Mon Dec 15, 2014 2:55 am

Re: elemental functions

Postby fewl9012 » Mon Aug 31, 2015 2:35 pm

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.
fewl9012
 
Posts: 67
Joined: Mon Jul 27, 2015 4:50 pm

Re: elemental functions

Postby xtian » Tue Sep 01, 2015 11:16 am

The declare simd directive should be allowed in the pure/elemental function.
xtian
 
Posts: 6
Joined: Fri Apr 05, 2013 4:55 pm


Return to OpenMP 4.1 DRAFT - Public Comments

Who is online

Users browsing this forum: No registered users and 1 guest

cron