From: Jonathan L Long Date: Tue, 10 Jun 2014 21:45:36 +0000 (-0700) Subject: move CUDA 6.0 check into switch statement itself X-Git-Tag: submit/tizen/20180823.020014~653^2~101^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c41c15a138de23e0bba80c31ad7813f556be6be4;p=platform%2Fupstream%2Fcaffeonacl.git move CUDA 6.0 check into switch statement itself This allows -Wswitch to be turned on so that the compiler can check exhaustiveness. --- diff --git a/include/caffe/common.hpp b/include/caffe/common.hpp index 7bfa5d4..bd4e39f 100644 --- a/include/caffe/common.hpp +++ b/include/caffe/common.hpp @@ -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 diff --git a/src/caffe/common.cpp b/src/caffe/common.cpp index 387d008..2964b2c 100644 --- a/src/caffe/common.cpp +++ b/src/caffe/common.cpp @@ -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"; }