1

I am trying to compile a basic memory transfer code using PGI's fortran compiler(Workstation/PGI Visual Fortran). The compiler throws an error on the line where I have a cudamemcpy call. The exact error message is "Could not resolve generic procedure cudamemcpy" for the line

istat=cudaMemcpy(arr(1),arr(2),800,cudaMemcpyDevicetoDevice)

I am also using the cuda fortran module--"use cudafor". What's the solution to this compiler error? Thanks!

1
  • 1
    What is arr? What is 800? I know what it is supposed to be in the context of CUDA, I am interested in what those values mean to you application. Commented Oct 1, 2014 at 7:25

1 Answer 1

1

The arrays arr(1) and arr(2) are of type

type subgrid
   integer, device, dimension(:,:,:), allocatable :: field
end type subgrid

The problem was resolved by not using the 4th argument and by specifying the actual field data that needed to be transferred. 800 is the number of integers I needed to be transferred from one slice to the other.

istat=cudaMemcpy(arr(1)%field(:,:,:), arr(2)%field(:,:,:), 800)

Also, the cudaMemcpyDevicetoDevice doesn't affect the function call. It works fine with/without it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.