Hi,
I’d like to file an issue with cudaMemcpy3d function.
It seams to be ignoring cudaPos (src/dst) if pointed memory is on CPU side.
For example:
...
cudaMemcpy3DParms parCpy3D = {0};
parCpy3D.dstPtr = make_cudaPitchedPtr(ptr, lineSize, dim.x * sizeof(T), dim.y);
parCpy3D.srcPtr = make_cudaPitchedPtr(d.ptr, d.lineSize, d.dim.x * sizeof(T), d.dim.y);
parCpy3D.dstPos = make_cudaPos(startROI.x * sizeof(T), startROI.y, startROI.z);
parCpy3D.srcPos = make_cudaPos(d.startROI.x * sizeof(T), d.startROI.y, d.startROI.z);
parCpy3D.kind = direction;
parCpy3D.extent = make_cudaExtent(d.sizeROI.x * sizeof(T), d.sizeROI.y, d.sizeROI.z);
cudaSafeCall( cudaMemcpy3D( &parCpy3D), "Data - memory copy error");
...
the code won’t work properly if direction is one of: cudaMemcpyHostToHost, cudaMemcpyHostToDevice or cudaMemcpyDeviceToHost.
There’s no error returned, but data is copied to/from the beginning of the pointed memory.
My system:
cuda 3.2, 266.58 driver, GF 420m, Win7 x64.
The way around is to move a pointer to the actual start location, but I don’t see a reason why it shouldn’t be done by the function.
Thanks,
Greg