From dbe1b57a71248946ade29c762817699fd1adc3ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gin=C3=A9s=20Hidalgo?= Date: Wed, 20 Oct 2021 14:24:21 -0400 Subject: [PATCH] Update thread_utils.cc --- onnxruntime/core/util/thread_utils.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/util/thread_utils.cc b/onnxruntime/core/util/thread_utils.cc index f6ce767046..372b933a25 100644 --- a/onnxruntime/core/util/thread_utils.cc +++ b/onnxruntime/core/util/thread_utils.cc @@ -85,8 +85,8 @@ ORT_API_STATUS_IMPL(SetGlobalSpinControl, _Inout_ OrtThreadingOptions* tp_option if (!(allow_spinning == 1 || allow_spinning == 0)) { return OrtApis::CreateStatus(ORT_INVALID_ARGUMENT, "Received invalid value for allow_spinning. Valid values are 0 or 1"); } - tp_options->intra_op_thread_pool_params.allow_spinning = static_cast(allow_spinning); - tp_options->inter_op_thread_pool_params.allow_spinning = static_cast(allow_spinning); + tp_options->intra_op_thread_pool_params.allow_spinning = (allow_spinning != 0); + tp_options->inter_op_thread_pool_params.allow_spinning = (allow_spinning != 0); return nullptr; }