[Cmake-commits] CMake branch, next, updated. v3.7.1-1784-g0045e4b

Brad King brad.king at kitware.com
Thu Dec 15 16:18:12 EST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  0045e4ba1b8b8fe57651f1ce5411f2061d79bdd4 (commit)
       via  c59811a233267a21fdea14af4bc6583af0f8d9b0 (commit)
      from  a22263ea280290e0255b9b6e73dd0e9b45f799e4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0045e4ba1b8b8fe57651f1ce5411f2061d79bdd4
commit 0045e4ba1b8b8fe57651f1ce5411f2061d79bdd4
Merge: a22263e c59811a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Dec 15 16:18:11 2016 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Dec 15 16:18:11 2016 -0500

    Merge topic 'cuda_tests_now_explain_why_they_fail' into next
    
    c59811a2 CUDA: Tests now state why they are failing when no CUDA card is found.


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c59811a233267a21fdea14af4bc6583af0f8d9b0
commit c59811a233267a21fdea14af4bc6583af0f8d9b0
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Thu Dec 15 15:57:01 2016 -0500
Commit:     Robert Maynard <robert.maynard at kitware.com>
CommitDate: Thu Dec 15 15:57:01 2016 -0500

    CUDA: Tests now state why they are failing when no CUDA card is found.

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;
     }
 }
diff --git a/Tests/Cuda/Complex/file3.cu b/Tests/Cuda/Complex/file3.cu
index 3c5e952..47e64c5 100644
--- a/Tests/Cuda/Complex/file3.cu
+++ b/Tests/Cuda/Complex/file3.cu
@@ -11,8 +11,6 @@ static
 __global__
 void file3_kernel(result_type& r, int x)
 {
-  //call static_func which is a method that is defined in the
-  //static library that is always out of date
   r = file1_func(x);
   result_type_dynamic rd = file2_func(x);
 }
@@ -21,5 +19,11 @@ int file3_launch_kernel(int x)
 {
   result_type r;
   file3_kernel <<<1,1>>> (r,x);
+  cudaError_t err = cudaGetLastError();
+  if(err == cudaSuccess)
+    {
+    std::cerr << cudaGetErrorString(err) << std::endl;
+    return x;
+    }
   return r.sum;
 }
diff --git a/Tests/Cuda/Complex/mixed.cu b/Tests/Cuda/Complex/mixed.cu
index d2e8275..45b412f 100644
--- a/Tests/Cuda/Complex/mixed.cu
+++ b/Tests/Cuda/Complex/mixed.cu
@@ -7,18 +7,20 @@
 result_type __device__ file1_func(int x);
 result_type_dynamic __device__ file2_func(int x);
 
+void __host__ cuda_dynamic_lib_func();
+
 static
 __global__
 void mixed_kernel(result_type& r, int x)
 {
-  //call static_func which is a method that is defined in the
-  //static library that is always out of date
   r = file1_func(x);
   result_type_dynamic rd = file2_func(x);
 }
 
 int mixed_launch_kernel(int x)
 {
+  cuda_dynamic_lib_func();
+
   result_type r;
   mixed_kernel <<<1,1>>> (r,x);
   return r.sum;
diff --git a/Tests/CudaOnly/WithDefs/main.notcu b/Tests/CudaOnly/WithDefs/main.notcu
index 6b02bbc..33a49d2 100644
--- a/Tests/CudaOnly/WithDefs/main.notcu
+++ b/Tests/CudaOnly/WithDefs/main.notcu
@@ -40,6 +40,7 @@ int main(int argc, char **argv)
   err = cudaGetDeviceCount(&nDevices);
   if(err != cudaSuccess)
     {
+      std::cerr << cudaGetErrorString(err) << std::endl;
       return 1;
     }
   return 0;

-----------------------------------------------------------------------

Summary of changes:
 Tests/Cuda/Complex/dynamic.cu      |   12 +++++-------
 Tests/Cuda/Complex/file3.cu        |    8 ++++++--
 Tests/Cuda/Complex/mixed.cu        |    6 ++++--
 Tests/CudaOnly/WithDefs/main.notcu |    1 +
 4 files changed, 16 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list