Function calls within a pragma region!

How can we call a user defined function within a pragma accregion?? I’ve tried almost everything and the compiler still says :

kernel_PGI:
41, Accelerator region ignored
50, Accelerator restriction: function/procedure calls are not supported
58, Accelerator restriction: unsupported call to ‘dotProduct’
PGC/x86-64 Linux 11.3-0: compilation completed with warnings

I guess it’s allowed to call functions within the kernel, but how can I do it? If my functions is for instance :

float dotProduct{
return 5.0;
}

Hi luiceur,

How can we call a user defined function within a pragma accregion?

Functions need to be inlined before they can used within an accelerator compute region. We do plan on adding support for calling CUDA C/Fortran routines from within acc regions in a later release.

For a simple function, like your dotProduct example, the compiler will be able to automatically inline them if you add the “-Minline” option when the functions are within the same file, or “-Mipa=inline” when the functions are in separate files. For functions where the compiler is unable to auto-inline, you will need to manually inline them.

Hope this helps,
Mat