diff --git a/cmake/Cuda.cmake b/cmake/Cuda.cmake index bfc42b5c130f..1814c2bdc441 100644 --- a/cmake/Cuda.cmake +++ b/cmake/Cuda.cmake @@ -162,6 +162,10 @@ macro(mshadow_cuda_compile objlist_variable) if(APPLE) list(APPEND CUDA_NVCC_FLAGS -Xcompiler -Wno-unused-function) endif() + + if(NOT NDEBUG) + list(APPEND CUDA_NVCC_FLAGS -G) + endif() if(MSVC) # disable noisy warnings: diff --git a/mshadow/base.h b/mshadow/base.h index 13a5dfa79a0d..240b76a0627c 100644 --- a/mshadow/base.h +++ b/mshadow/base.h @@ -238,7 +238,7 @@ extern "C" { } \ } -#if !(MSHADOW_USE_CUDA && MSHADOW_USE_CUDNN == 1 && CUDNN_MAJOR >= 5) +#if !(MSHADOW_USE_CUDA && MSHADOW_USE_CUDNN == 1 && CUDNN_MAJOR >= 4) /*! \brief dummy definition when not using cudnn */ typedef int cudnnTensorFormat_t; #endif @@ -321,7 +321,7 @@ struct LayoutType; template<> struct LayoutType { static const index_t kNdim = 4; -#if (MSHADOW_USE_CUDA && MSHADOW_USE_CUDNN == 1 && CUDNN_MAJOR >= 5) +#if (MSHADOW_USE_CUDA && MSHADOW_USE_CUDNN == 1 && CUDNN_MAJOR >= 4) static const cudnnTensorFormat_t kCudnnFlag = CUDNN_TENSOR_NCHW; #else static const cudnnTensorFormat_t kCudnnFlag = -1; @@ -331,7 +331,7 @@ struct LayoutType { template<> struct LayoutType { static const index_t kNdim = 4; -#if (MSHADOW_USE_CUDA && MSHADOW_USE_CUDNN == 1 && CUDNN_MAJOR >= 5) +#if (MSHADOW_USE_CUDA && MSHADOW_USE_CUDNN == 1 && CUDNN_MAJOR >= 4) static const cudnnTensorFormat_t kCudnnFlag = CUDNN_TENSOR_NHWC; #else static const cudnnTensorFormat_t kCudnnFlag = -1; @@ -344,7 +344,7 @@ const int default_layout = kNCHW; template<> struct LayoutType { static const index_t kNdim = 5; -#if (MSHADOW_USE_CUDA && MSHADOW_USE_CUDNN == 1 && CUDNN_MAJOR >= 5) +#if (MSHADOW_USE_CUDA && MSHADOW_USE_CUDNN == 1 && CUDNN_MAJOR >= 4) static const cudnnTensorFormat_t kCudnnFlag = CUDNN_TENSOR_NCHW; #else static const cudnnTensorFormat_t kCudnnFlag = -1; @@ -354,7 +354,7 @@ struct LayoutType { template<> struct LayoutType { static const index_t kNdim = 5; -#if (MSHADOW_USE_CUDA && MSHADOW_USE_CUDNN == 1 && CUDNN_MAJOR >= 5) +#if (MSHADOW_USE_CUDA && MSHADOW_USE_CUDNN == 1 && CUDNN_MAJOR >= 4) static const cudnnTensorFormat_t kCudnnFlag = CUDNN_TENSOR_NHWC; #else static const cudnnTensorFormat_t kCudnnFlag = -1;