Tests/Cuda: Print error message if an error occurred

Fixes c59811a2 "CUDA: Tests now state why they are failing when no CUDA card is found."
This commit is contained in:
Pierre Moreau
2017-02-02 13:40:42 +01:00
committed by Brad King
parent ee3295e917
commit 84f3c87b03
2 changed files with 2 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ EXPORT void cuda_dynamic_lib_func()
{
DetermineIfValidCudaDevice <<<1,1>>> ();
cudaError_t err = cudaGetLastError();
if(err == cudaSuccess)
if(err != cudaSuccess)
{
std::cerr << cudaGetErrorString(err) << std::endl;
}

View File

@@ -20,7 +20,7 @@ int file3_launch_kernel(int x)
result_type r;
file3_kernel <<<1,1>>> (r,x);
cudaError_t err = cudaGetLastError();
if(err == cudaSuccess)
if(err != cudaSuccess)
{
std::cerr << cudaGetErrorString(err) << std::endl;
return x;