Skip to content

Commit 4f10039

Browse files
authored
Merge pull request #12392 from typhoonzero/fix_cudnn_enforce
fix cudnn enforce
2 parents 3ade95d + 54e9fd3 commit 4f10039

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

paddle/fluid/platform/cudnn_helper.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@ inline const char* cudnnGetErrorString(cudnnStatus_t status) {
5959
#define CUDNN_VERSION_MIN(major, minor, patch) \
6060
(CUDNN_VERSION >= ((major)*1000 + (minor)*100 + (patch)))
6161

62-
#define CUDNN_ENFORCE(condition) \
63-
do { \
64-
cudnnStatus_t status = condition; \
65-
if (status != CUDNN_STATUS_SUCCESS) { \
66-
VLOG(1) << ::paddle::platform::cudnnGetErrorString(status); \
67-
PADDLE_THROW("cuDNN call failed"); \
68-
} \
62+
#define CUDNN_ENFORCE(condition) \
63+
do { \
64+
cudnnStatus_t status = condition; \
65+
if (UNLIKELY(status != CUDNN_STATUS_SUCCESS)) { \
66+
PADDLE_THROW(::paddle::platform::cudnnGetErrorString(status)); \
67+
} \
6968
} while (false)
7069

7170
enum class DataLayout { // Not use

0 commit comments

Comments
 (0)