Skip to content

Commit 97f0ec2

Browse files
qingqing01luotao1
authored andcommitted
Fix compiling error with cuDNN 5.1 (#17458)
test=develop
1 parent 3d4e826 commit 97f0ec2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

paddle/fluid/platform/cudnn_desc.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,17 @@ class ConvolutionDescriptor {
183183
CUDNN_ENFORCE(dynload::cudnnSetConvolutionNdDescriptor(
184184
desc, pads.size(), pads.data(), strides.data(), dilations.data(),
185185
CUDNN_CROSS_CORRELATION, compute_type));
186-
CUDNN_ENFORCE(platform::dynload::cudnnSetConvolutionMathType(
187-
desc, CUDNN_DEFAULT_MATH));
188186
#if CUDNN_VERSION_MIN(7, 0, 1)
189187
CUDNN_ENFORCE(
190188
platform::dynload::cudnnSetConvolutionGroupCount(desc, groups));
189+
#if CUDA_VERSION >= 9000 && CUDNN_VERSION_MIN(7, 0, 1)
190+
CUDNN_ENFORCE(platform::dynload::cudnnSetConvolutionMathType(
191+
desc, CUDNN_DEFAULT_MATH));
191192
if (dtype == CUDNN_DATA_HALF) {
192193
CUDNN_ENFORCE(platform::dynload::cudnnSetConvolutionMathType(
193194
desc, CUDNN_TENSOR_OP_MATH));
194195
}
196+
#endif
195197
#endif
196198
}
197199

0 commit comments

Comments
 (0)