From 84f3c87b030037646c1110b1e4237f597ad3dd88 Mon Sep 17 00:00:00 2001 From: Pierre Moreau Date: Thu, 2 Feb 2017 13:40:42 +0100 Subject: 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." --- Tests/Cuda/Complex/dynamic.cu | 2 +- Tests/Cuda/Complex/file3.cu | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Cuda/Complex/dynamic.cu b/Tests/Cuda/Complex/dynamic.cu index a23dc25..b0a27d4 100644 --- a/Tests/Cuda/Complex/dynamic.cu +++ b/Tests/Cuda/Complex/dynamic.cu @@ -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; } diff --git a/Tests/Cuda/Complex/file3.cu b/Tests/Cuda/Complex/file3.cu index 47e64c5..0c8a09b 100644 --- a/Tests/Cuda/Complex/file3.cu +++ b/Tests/Cuda/Complex/file3.cu @@ -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; -- cgit v0.12