Openacc2.0 routine directive

I am trying to use the routine directive which is implemented in openacc2.0 to replace the inline functions.
I get this error :
PGC-S-0155-misplaced #pragma acc routine

I used the same syntax for the one more function in the same program it works, but it fails for 2 more functions.

Is there any problem with this.
FYI : I am using PGI/14.2 compiler.

Thanks in advance.

Hi Poojachitral,

Can you please post an example? “routine” is new in 14.1/14.2 and it’s possible we missed a case.

Note that functions that return structs are not yet supported nor is cross file compilation when targeting AMD targets due to limitations in OpenCL (NVIDIA is fine since we can use a device linker).

  • Mat