Device routines must be in the same module as the caller

I’m using 12.5 and try to use device function defined in module in another module.
Compiler says:
“Device routines called must be in the same module as the caller”.

There is said, that in 11 release data made available through different modules. Do you have any progress on cross-module subroutines support? Do you support in newer compiler versions or maybe will support in future?

Hi Senya,

This was a limit in how the underlying NVIDIA CUDA tools worked. All device routines must be inlined and therefore contained within the same module as the caller. This restriction has been loosened with CUDA 5.0 and PGI CUDA Fortran 2013 where “relocatable device code” has been made available. To utilize this feature, please add “-Mcuda=rdc” to both your compilation and link.

Hope this helps,

Is there some special requirements for GPU to support this feature?

Hi Senya,

rdc requires CUDA 5.0 and a device with compute capable 2.0 or greater.

  • Mat

Thanks for help.