From 7010a5da1a0d91da41fddd4799eff157efa19014 Mon Sep 17 00:00:00 2001 From: liaogang Date: Sat, 15 Jul 2017 10:09:08 +0800 Subject: [PATCH] FIX: throw_on_error on cuda --- paddle/platform/enforce.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/platform/enforce.h b/paddle/platform/enforce.h index 0e40bd798c1..9431204a687 100644 --- a/paddle/platform/enforce.h +++ b/paddle/platform/enforce.h @@ -78,7 +78,7 @@ class EnforceNotMet : public std::exception { template inline void throw_on_error(cudaError_t e, const Args&... args) { - if (UNLIKELY(!(e))) { + if (e) { std::stringstream ss; ss << ::paddle::string::Sprintf(args...); ss << ::paddle::string::Sprintf(" at [%s:%s];", __FILE__, __LINE__); -- GitLab