Passing shared memory in device subroutine

I tried passing shared memory array to device subroutines , while disabling “rdc” which from what I have read so far causes issues in such cases. I will like to know why the translation fails

pgfortran -g -Mcuda=nordc,llvm,ptxinfo,cc3+,keepgpu,keepptx -Minfo=ccff -O0   -c precision_m.F90
pgfortran -g -Mcuda=nordc,llvm,ptxinfo,cc3+,keepgpu,keepptx -Minfo=ccff -O0   -c cpurandom_m.F90
cpp  -DGLOBAL host_gen_m.CUF > host_gen_m1.CUF
pgfortran -Mcuda=nordc,ptxinfo,cc3+,keepgpu,keepptx -Minfo=ccff -O0   -c host_gen_m1.CUF
cpp  -DSHARED host_subs_m.CUF > host_subs_m1.CUF
pgfortran -Mcuda=nordc,ptxinfo,cc3+,keepgpu,keepptx -Minfo=ccff -O0   -c host_subs_m1.CUF

output message:

PGF90-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Unsupported procedure (host_subs_m1.CUF: 1)
PGF90/x86-64 Linux 14.10-0: compilation aborted
make: *** [host_subs_m1.o] Error 2

Hi egodfred,

RDC is required when calling device routines from device code found in external modules or when accessing external module data from device code. Are you trying to call a external device routine?

I tried to replicate the error so I could give you a more definitive answers but didn’t see the error with the code you sent. Though I don’t see “SHARED” in the code so assuming it’s changed since then.

  • Mat