From 6197eb6b907798e0663acaa8cb68d9c4d9d485c5 Mon Sep 17 00:00:00 2001 From: Timo Kleimola Date: Fri, 24 Nov 2023 14:00:17 +0200 Subject: [PATCH] Add a const for spin cycles --- include/onnxruntime/core/common/spin_pause.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/onnxruntime/core/common/spin_pause.h b/include/onnxruntime/core/common/spin_pause.h index 67328af9180c0..13da75c3b4721 100644 --- a/include/onnxruntime/core/common/spin_pause.h +++ b/include/onnxruntime/core/common/spin_pause.h @@ -25,7 +25,8 @@ inline void SpinPause() { inline void SpinTPAUSE() { #if defined(_M_AMD64) || defined(__x86_64__) - _tpause(0x0, __rdtsc() + 2000); + const uint64_t spin_delay_cycles = 2000; + _tpause(0x0, __rdtsc() + spin_delay_cycles); #endif }