In case wrong line number gives you a hard time when you debug your CUDA code (active line of code in single step is a few lines off from what actually executed), you might find this useful.
Apparently CUDA 2 Beta has a bug in assigning the line number in debug info when you use a macro like CUDA_SAFE_CALL and break the call in multiple lines, like the example below in multiple lines:
CUDA_SAFE_CALL(cudaMemcpy(a,
dev_a,
sizeof(a),
cudaMemcpyDeviceToHost) );
Write it in single line and it won’t mess with your line no debug info:
CUDA_SAFE_CALL(cudaMemcpy(a, dev_a, sizeof(a), cudaMemcpyDeviceToHost) );