Skip to content

Commit

Permalink
Merge pull request #11224 from dzhwinter/fix/cudnn
Browse files Browse the repository at this point in the history
fix cudnn version issue
  • Loading branch information
panyx0718 authored Jun 7, 2018
2 parents 3a29404 + 44c662b commit ca2d6d3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions paddle/fluid/platform/cudnn_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,27 @@ enum class PoolingMode {
kMaximumDeterministic,
};

#if CUDNN_VERSION < 6000
#pragma message "CUDNN version under 6.0 is supported at best effort."
#pragma message "We strongly encourage you to move to 6.0 and above."
#pragma message "This message is intended to annoy you enough to update."
#pragma message \
"please see https://docs.nvidia.com/deeplearning/sdk/cudnn-release-notes/"

inline cudnnPoolingMode_t GetPoolingMode(const PoolingMode& mode) {
switch (mode) {
case PoolingMode::kMaximumDeterministic:
return CUDNN_POOLING_MAX;
case PoolingMode::kAverage:
return CUDNN_POOLING_AVERAGE_COUNT_EXCLUDE_PADDING;
case PoolingMode::kMaximum:
return CUDNN_POOLING_MAX;
default:
PADDLE_THROW("Unexpected pooling mode.");
}
}
#else

inline cudnnPoolingMode_t GetPoolingMode(const PoolingMode& mode) {
switch (mode) {
case PoolingMode::kMaximumDeterministic:
Expand All @@ -93,6 +114,7 @@ inline cudnnPoolingMode_t GetPoolingMode(const PoolingMode& mode) {
PADDLE_THROW("Unexpected pooling mode.");
}
}
#endif // CUDNN_VERSION < 6000

template <typename T>
class CudnnDataType;
Expand Down

0 comments on commit ca2d6d3

Please sign in to comment.