This program work as intended here, i.e. it prints “1”. It’s good practice to check the error codes from all API functions. I suspect that CUDA failed to initialize on your system. This can happen for a number of reasons (e.g. a driver mismatch). Below is a version of the code that includes return code checking.
This program work as intended here, i.e. it prints “1”. It’s good practice to check the error codes from all API functions. I suspect that CUDA failed to initialize on your system. This can happen for a number of reasons (e.g. a driver mismatch). Below is a version of the code that includes return code checking.
Thank you for your answer.
There is an error:
Cuda error in ‘testsafe.cu’ in line 27 : unspecified driver error.
Line 27 is: CUDA_SAFE_CALL (cudaMemcpy2D(&b, pitch, &a, nsizeof(int), nsizeof(int), m, cudaMemcpyHostToDevice));
I know now that the configuration is wrong an not the code.
Thank you for your answer.
There is an error:
Cuda error in ‘testsafe.cu’ in line 27 : unspecified driver error.
Line 27 is: CUDA_SAFE_CALL (cudaMemcpy2D(&b, pitch, &a, nsizeof(int), nsizeof(int), m, cudaMemcpyHostToDevice));
I know now that the configuration is wrong an not the code.