Copying a struct containing pointers to CUDA device
Edit: CUDA 6 introduces Unified Memory, which makes this “deep copy” problem a lot easier. See this post for more details. Don’t forget that you can pass structures by value to kernels. This code works: // pass struct by value (may not be efficient for complex structures) __global__ void kernel2(StructA in) { in.arr[threadIdx.x] *= 2; … Read more