Skip to content

Commit e787e7f

Browse files
Delete cudnn6 code
1 parent 1ff4708 commit e787e7f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

paddle/fluid/platform/cudnn_helper.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,22 @@ enum class ActivationMode {
9191
kBandPass,
9292
};
9393

94+
inline cudnnPoolingMode_t GetPoolingMode(const PoolingMode& mode) {
95+
switch (mode) {
96+
case PoolingMode::kMaximumDeterministic:
97+
return CUDNN_POOLING_MAX_DETERMINISTIC;
98+
case PoolingMode::kAverageExclusive:
99+
return CUDNN_POOLING_AVERAGE_COUNT_EXCLUDE_PADDING;
100+
case PoolingMode::kAverageInclusive:
101+
return CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING;
102+
case PoolingMode::kMaximum:
103+
return CUDNN_POOLING_MAX;
104+
default:
105+
PADDLE_THROW(
106+
platform::errors::Unimplemented("Unexpected CUDNN pooling mode."));
107+
}
108+
}
109+
94110
inline ActivationMode StringToActivationMode(const std::string& str) {
95111
if (str == "identity") {
96112
return ActivationMode::kNone;

0 commit comments

Comments
 (0)