move CUDA 6.0 check into switch statement itself
authorJonathan L Long <jonlong@cs.berkeley.edu>
Tue, 10 Jun 2014 21:45:36 +0000 (14:45 -0700)
committerEvan Shelhamer <shelhamer@imaginarynumber.net>
Wed, 25 Jun 2014 22:11:41 +0000 (15:11 -0700)
This allows -Wswitch to be turned on so that the compiler can check
exhaustiveness.

include/caffe/common.hpp
src/caffe/common.cpp

index 7bfa5d4..bd4e39f 100644 (file)
@@ -56,11 +56,6 @@ private:\
 // CUDA: check for error after kernel execution and exit loudly if there is one.
 #define CUDA_POST_KERNEL_CHECK CUDA_CHECK(cudaPeekAtLastError())
 
-// Define not supported status for pre-6.0 compatibility.
-#if CUDA_VERSION < 6000
-#define CUBLAS_STATUS_NOT_SUPPORTED 831486
-#endif
-
 namespace caffe {
 
 // We will use the boost shared_ptr instead of the new C++11 one mainly
index 387d008..2964b2c 100644 (file)
@@ -156,8 +156,10 @@ const char* cublasGetErrorString(cublasStatus_t error) {
     return "CUBLAS_STATUS_EXECUTION_FAILED";
   case CUBLAS_STATUS_INTERNAL_ERROR:
     return "CUBLAS_STATUS_INTERNAL_ERROR";
+#if CUDA_VERSION >= 6000
   case CUBLAS_STATUS_NOT_SUPPORTED:
     return "CUBLAS_STATUS_NOT_SUPPORTED";
+#endif
   }
   return "Unknown cublas status";
 }