From 5be0fa13c0d3fd60ace846c5c2394b16ff6c2e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gin=C3=A9s=20Hidalgo?= Date: Mon, 13 Dec 2021 19:24:00 -0500 Subject: [PATCH] [DML] Fixed huge bug in ORT_NO_EXCEPTIONS for DML back end, the check is reversed --- .../providers/dml/DmlExecutionProvider/src/ErrorHandling.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ErrorHandling.h b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ErrorHandling.h index d358a30e7e..c59ad56e43 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ErrorHandling.h +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ErrorHandling.h @@ -60,13 +60,13 @@ #endif #ifdef ORT_NO_EXCEPTIONS -#define ORT_THROW_HR_IF(hr, condition) ORT_ENFORCE(condition, hr) +#define ORT_THROW_HR_IF(hr, condition) ORT_ENFORCE(!(condition), hr) #else #define ORT_THROW_HR_IF(hr, condition) THROW_HR_IF(hr, condition) #endif #ifdef ORT_NO_EXCEPTIONS -#define ORT_THROW_LAST_ERROR_IF(condition) ORT_ENFORCE(condition) +#define ORT_THROW_LAST_ERROR_IF(condition) ORT_ENFORCE(!(condition)) #else #define ORT_THROW_LAST_ERROR_IF(condition) THROW_LAST_ERROR_IF(condition) #endif