memcpy() on the device

I would like to copy data on the device.

For example, “DATA” is a struct

device void FunctionA(DATA *s, DATA *t)
{
[indent] …

  memcpy(s, t, sizeof(DATA));      

  ...[/indent]

}

When I use “memcpy” to copy data, there are some “noise” on my resulting image

Is there any better way to copy data on the device ?

I might be wrong here, but I was under the impression that you aren’t supposed to do this.
Instead, try using cudaMemcpy under the DeviceToDevice param.

I might be wrong here, but I was under the impression that you aren’t supposed to do this.
Instead, try using cudaMemcpy under the DeviceToDevice param.

memcpy() is supported in device code for doing small per-thread copies, but for large copies I would recommend using cudaMemcpy from the host.

memcpy() is supported in device code for doing small per-thread copies, but for large copies I would recommend using cudaMemcpy from the host.