Skip to content

Commit 9ab613a

Browse files
authored
Update mlasi.h
1 parent c0a3f6b commit 9ab613a

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

onnxruntime/core/mlas/lib/mlasi.h

+3-12
Original file line numberDiff line numberDiff line change
@@ -2479,21 +2479,12 @@ MlasReadTimeStampCounter(void)
24792479
// Aligned buffer for GEMM packing, etc.
24802480
//
24812481

2482-
#ifdef MLAS_THREAD_LOCAL
2483-
#error MLAS_THREAD_LOCAL was previously defined
2484-
#endif
2485-
#if defined(_MSC_VER)
2486-
#define MLAS_THREAD_LOCAL __declspec(thread)
2487-
#else
2488-
#define MLAS_THREAD_LOCAL
2489-
#endif
2490-
24912482
constexpr size_t ThreadedBufAlignment = 64;
2492-
extern MLAS_THREAD_LOCAL size_t ThreadedBufSize;
2483+
extern thread_local size_t ThreadedBufSize;
24932484
#ifdef _MSC_VER
2494-
extern MLAS_THREAD_LOCAL std::unique_ptr<uint8_t, decltype(&_aligned_free)> ThreadedBufHolder;
2485+
extern thread_local std::unique_ptr<uint8_t, decltype(&_aligned_free)> ThreadedBufHolder;
24952486
#else
2496-
extern MLAS_THREAD_LOCAL std::unique_ptr<uint8_t, decltype(&free)> ThreadedBufHolder;
2487+
extern thread_local std::unique_ptr<uint8_t, decltype(&free)> ThreadedBufHolder;
24972488
#endif
24982489

24992490
MLAS_FORCEINLINE

0 commit comments

Comments
 (0)