More than one device-resident object in assignment

Hello! I get the following error:

Error S0519 - More than one device-resident object in assignment

when i try to performe the following operations:

u_dev(i,j) = u_dev(i-1,j)
zb_dev(i_ini_dev(k):i_end_dev(k)) = ...

where all the arrays are allocatable ones located on device memory. Is there any way to get those operations working other than using a temporary scalar variable? (Which I suppose is a pretty inefficient way of solving the problem…)

Thanks in advance for you help,


Hi Nicola,

I would have to see the exact line triggering the error in order to more precisely help you with this. However, it may be helpful to refer to the section entitled “Implicit Data Transfer in Expressions” in the PGI CUDA Fortran Programming Guide, pp. 19-20, for information about data transfers between host and device. There are some examples of expressions here which are not legal in CUDA Fortran. You may be using an expression similar to these in your application.

Hope this helps.

Hi cparrott, I found the “solution”. Since I’m porting a complex 2D code for OMP accelerated FORTRAN to CUDA FORTRAN, yesterday I was just creating the device variables I need without building the corresponding device subroutine’s structure: that was the problem given by the compiler.

So, in order to port a code, it’s better to rewrite every subroutine at a time and not the whole code.

Thanks for the help,