cudaMemcpy3D Incorrect returned values

I’m facing a strange behavior using the 3D memory copy function from device memory to a cuda array.

First test case:

cudaMemcpy3DParms copyParams1 = {0};

copyParams1.srcPtr = make_cudaPitchedPtr((void*)(data_mem), dataSize.width*sizeof(float4), dataSize.width, dataSize.height);

copyParams1.dstArray = data_array;

copyParams1.extent = make_cudaExtent(dataSize.width,dataSize.height,dataSize.dept
h);
copyParams1.kind = cudaMemcpyDeviceToDevice;
CUDA_SAFE_CALL( cudaMemcpy3D(&copyParams1) );
cudaThreadSynchronize();

The results returned by the texture bound to the array and the memory is identical.

Second test case:

Same as first but with
data_tex.filterMode = cudaFilterModeLinear;

The results returned are not identical and not even close! Although I’m referencing the texture with exactly same integers (not floats)

Third test case:

cudaMemcpy3DParms copyParams1 = {0};

copyParams1.srcPtr = make_cudaPitchedPtr((void*)(data_mem), dataSize.widthsizeof(float4), dataSize.width, dataSize.height);
copyParams1.srcPos = make_cudaPos(mdx
sizeof(float4),mdy,mdz);

copyParams1.dstArray = data_array;
copyParams1.dstPos = make_cudaPos(mdx,mdy,mdz);

copyParams1.extent = boxSize;
copyParams1.kind = cudaMemcpyDeviceToDevice;
CUDA_SAFE_CALL( cudaMemcpy3D(&copyParams1) );
cudaThreadSynchronize();

The results returned are not identical and not even close! Although I’m referencing the texture with exactly same integers (not floats)

Fourth test case:

Same as Third but with
data_tex.filterMode = cudaFilterModeLinear;

The results returned are not identical and not even close! Although I’m referencing the texture with exactly same integers (not floats)

Please help me figure out why this does not work. Do not refer me to http://forums.nvidia.com/index.php?showtop…daMemcpy3DParms
Since it does not discuss these cases.

Thank you