A device subprogram can only access a device variable declared within the same module (See section 2.1.1 of the CUDA Fortran programming guide) The reason for this is that there isn’t a linker (at least not yet) for the GPU so there is no way to associate the global variables instantiated in one module with one instantiated in another. In other words, each time you used “gpudata”, a new copy of d_int would be created.
The actual problem is that we’re not catching this semantic error. It just happened to work in this particular case for 10.1. If you moved “gpudata” to a separate file, then you would get the same error as you see now. Our engineers are working on catching this error.
Thanks for the information. In our code, I was carefully keeping our CUDA modules in the same file to avoid problems. I’ve updated the code as you suggested and everything works now.
Obviously, having a linker is a desirable feature — any idea when that might happen?