Browse Source

Tests/Cuda: Print error message if mixed_kernel failed

Pierre Moreau 8 years ago
parent
commit
21a125cdbf
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Tests/Cuda/Complex/mixed.cu

+ 7 - 0
Tests/Cuda/Complex/mixed.cu

@@ -31,5 +31,12 @@ EXPORT int mixed_launch_kernel(int x)
 
   result_type r;
   mixed_kernel <<<1,1>>> (r,x);
+  cudaError_t err = cudaGetLastError();
+  if(err != cudaSuccess)
+    {
+    std::cerr << "mixed_kernel [SYNC] failed: "
+              << cudaGetErrorString(err) << std::endl;
+    return x;
+    }
   return r.sum;
 }