Skip to content

Commit

Permalink
fix compile error with cudnn v4 (apache#183)
Browse files Browse the repository at this point in the history
add cuda debug with debug
  • Loading branch information
yajiedesign authored and piiswrong committed Dec 18, 2016
1 parent 50ca991 commit 28b6c08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions cmake/Cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions mshadow/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -321,7 +321,7 @@ struct LayoutType;
template<>
struct LayoutType<kNCHW> {
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;
Expand All @@ -331,7 +331,7 @@ struct LayoutType<kNCHW> {
template<>
struct LayoutType<kNHWC> {
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;
Expand All @@ -344,7 +344,7 @@ const int default_layout = kNCHW;
template<>
struct LayoutType<kNCDHW> {
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;
Expand All @@ -354,7 +354,7 @@ struct LayoutType<kNCDHW> {
template<>
struct LayoutType<kNDHWC> {
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;
Expand Down

0 comments on commit 28b6c08

Please sign in to comment.