From e519743860a5769706b0912ffae9c43984c3d3aa Mon Sep 17 00:00:00 2001 From: xmfbit Date: Tue, 23 May 2017 21:12:01 +0800 Subject: [PATCH] should be able to build --- include/caffe/util/cudnn.hpp | 10 ++++++++++ include/caffe/util/rng.hpp | 1 + src/caffe/layers/resample_layer.cu | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/caffe/util/cudnn.hpp b/include/caffe/util/cudnn.hpp index a7d8dbb..498cfe3 100644 --- a/include/caffe/util/cudnn.hpp +++ b/include/caffe/util/cudnn.hpp @@ -41,6 +41,10 @@ inline const char* cudnnGetErrorString(cudnnStatus_t status) { return "CUDNN_STATUS_NOT_SUPPORTED"; case CUDNN_STATUS_LICENSE_ERROR: return "CUDNN_STATUS_LICENSE_ERROR"; +#if CUDNN_VERSION_MIN(6, 0, 0) + case CUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING: + return "CUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING"; +#endif } return "Unknown cudnn status"; } @@ -109,8 +113,14 @@ template inline void setConvolutionDesc(cudnnConvolutionDescriptor_t* conv, cudnnTensorDescriptor_t bottom, cudnnFilterDescriptor_t filter, int pad_h, int pad_w, int stride_h, int stride_w) { +#if CUDNN_VERSION_MIN(6, 0, 0) CUDNN_CHECK(cudnnSetConvolution2dDescriptor(*conv, + pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION, + dataType::type)); +#else + CUDNN_CHECK(cudnnSetConvolution2dDescriptor(*conv, pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION)); +#endif } template diff --git a/include/caffe/util/rng.hpp b/include/caffe/util/rng.hpp index 8e4aa10..be16272 100644 --- a/include/caffe/util/rng.hpp +++ b/include/caffe/util/rng.hpp @@ -8,6 +8,7 @@ #include "boost/random/uniform_int.hpp" #include "caffe/common.hpp" +#include "caffe/proto/caffe.pb.h" namespace caffe { diff --git a/src/caffe/layers/resample_layer.cu b/src/caffe/layers/resample_layer.cu index 950cb15..3b739ac 100644 --- a/src/caffe/layers/resample_layer.cu +++ b/src/caffe/layers/resample_layer.cu @@ -7,7 +7,7 @@ #include "caffe/util/math_functions.hpp" #include -#include +//#include namespace caffe {