diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2016-12-15 20:57:01 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2016-12-15 20:57:01 (GMT) |
commit | c59811a233267a21fdea14af4bc6583af0f8d9b0 (patch) | |
tree | 65236f8adc333d4e565dae2e65fa07d1d857af8a /Tests/Cuda/Complex/dynamic.cu | |
parent | 59461c2696e46f5d3eaf5753ee4f7d2ee6eb71a6 (diff) | |
download | CMake-c59811a233267a21fdea14af4bc6583af0f8d9b0.zip CMake-c59811a233267a21fdea14af4bc6583af0f8d9b0.tar.gz CMake-c59811a233267a21fdea14af4bc6583af0f8d9b0.tar.bz2 |
CUDA: Tests now state why they are failing when no CUDA card is found.
Diffstat (limited to 'Tests/Cuda/Complex/dynamic.cu')
-rw-r--r-- | Tests/Cuda/Complex/dynamic.cu | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Tests/Cuda/Complex/dynamic.cu b/Tests/Cuda/Complex/dynamic.cu index 9540e86..ea52acb 100644 --- a/Tests/Cuda/Complex/dynamic.cu +++ b/Tests/Cuda/Complex/dynamic.cu @@ -1,6 +1,7 @@ #include <string> #include <cuda.h> +#include <iostream> int dynamic_base_func(int); @@ -15,15 +16,12 @@ void DetermineIfValidCudaDevice() { } -void cuda_dynamic_lib_func(std::string& contents ) +void cuda_dynamic_lib_func() { DetermineIfValidCudaDevice <<<1,1>>> (); - if(cudaSuccess == cudaGetLastError()) + cudaError_t err = cudaGetLastError(); + if(err == cudaSuccess) { - contents = "ran a cuda kernel"; - } - else - { - contents = "cant run a cuda kernel"; + std::cerr << cudaGetErrorString(err) << std::endl; } } |