CUDA Fortran: supported methods for data transfer

hello,
i’m playing with the matrix multiplication example given in CUDA Fortran Programming Guide & Ref, p. 43-44 and i can’t get the data back from the device. what methods are currently supported?

btw, i had to add “device” to line 8 (p.43)
real, device :: A(N,M), B(M,L), C(N,L)
to compile the example. Unfortunately when run it it breaks with
copyout Memcpy FAILED:4
i tried using cudaMemcpy2D to do explicit data transfer but still get errors (stat > 0)

thanks

Hi ink,

Looks like our docs people missed some updates. Try using the matrix multiply example found the “etc/samples” instead.

Thanks,
Mat

Mat,

I just tried the sgemm example and I got:

> pgfortran sgemm.cuf 
/usr/bin/ld: skipping incompatible /opt/cuda/lib/libcudart.so when searching for -lcudart
/usr/bin/ld: cannot find -lcudart

I currently have CUDA 2.3 installed. Does CUDA Fortran require a different version?

Hi TheMatt,

You are probably using a 64bit OS. You need to point the CUDALIB variable (located inside the sitenvrc) to the lib64 path of CUDA. In your case, it’s should be /opt/cuda/lib64.

Mathieu

You are absolutely right.

Now I’m wondering why this error never popped up while using the accelerators…

Thanks,
Matt