Skip to content

Commit 4ecbab4

Browse files
authored
Fix compile on cudnn7 (#5982)
* fix compile on cudnn7 * update * update * make silent
1 parent 0c0ff28 commit 4ecbab4

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

cmake/external/grpc.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ExternalProject_Add(
4242
# Disable -Werror, otherwise the compile will fail in MacOS.
4343
# It seems that we cannot configure that by make command.
4444
# Just dry run make command and remove `-Werror`, then use a shell to run make commands
45-
BUILD_COMMAND ${BUILD_CMD}
45+
BUILD_COMMAND ${BUILD_CMD} HAS_SYSTEM_PROTOBUF=false -s -j8 static grpc_cpp_plugin
4646
INSTALL_COMMAND make prefix=${GRPC_INSTALL_DIR} install
4747
)
4848

paddle/operators/conv_cudnn_op.cu.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class CudnnConvOpKernel : public framework::OpKernel<T> {
6363
cudnnConvolutionDescriptor_t cudnn_conv_desc =
6464
conv_desc.descriptor<T>(paddings, strides, dilations);
6565

66-
#if CUDNN_VERSION_MIN(7, 0, 0)
66+
#if CUDNN_VERSION_MIN(7, 0, 1)
6767
// cudnn 7 can support groups, no need to do it mannually
6868
// FIXME(typhoonzero): find a better way to disable groups
6969
// rather than setting it to 1.
@@ -180,7 +180,7 @@ class CudnnConvGradOpKernel : public framework::OpKernel<T> {
180180
cudnnConvolutionDescriptor_t cudnn_conv_desc =
181181
conv_desc.descriptor<T>(paddings, strides, dilations);
182182

183-
#if CUDNN_VERSION_MIN(7, 0, 0)
183+
#if CUDNN_VERSION_MIN(7, 0, 1)
184184
// cudnn 7 can support groups, no need to do it mannually
185185
// FIXME(typhoonzero): find a better way to disable groups
186186
// rather than setting it to 1.

paddle/platform/dynload/cudnn.cc

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ CUDNN_DNN_ROUTINE_EACH_AFTER_R4(DEFINE_WRAP);
3737
CUDNN_DNN_ROUTINE_EACH_R5(DEFINE_WRAP);
3838
#endif
3939

40+
#ifdef CUDNN_DNN_ROUTINE_EACH_R7
41+
CUDNN_DNN_ROUTINE_EACH_R7(DEFINE_WRAP);
42+
#endif
43+
4044
} // namespace dynload
4145
} // namespace platform
4246
} // namespace paddle

paddle/platform/dynload/cudnn.h

+6
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ CUDNN_DNN_ROUTINE_EACH_AFTER_R4(DECLARE_DYNAMIC_LOAD_CUDNN_WRAP)
135135
CUDNN_DNN_ROUTINE_EACH_R5(DECLARE_DYNAMIC_LOAD_CUDNN_WRAP)
136136
#endif
137137

138+
#if CUDNN_VERSION >= 7001
139+
#define CUDNN_DNN_ROUTINE_EACH_R7(__macro) \
140+
__macro(cudnnSetConvolutionGroupCount);
141+
CUDNN_DNN_ROUTINE_EACH_R7(DECLARE_DYNAMIC_LOAD_CUDNN_WRAP)
142+
#endif
143+
138144
} // namespace dynload
139145
} // namespace platform
140146
} // namespace paddle

0 commit comments

Comments
 (0)