From 21044846eefc0720e0c52bc075e4e701fcc2acc6 Mon Sep 17 00:00:00 2001 From: Tracy Sharpe <42477615+tracysh@users.noreply.github.com> Date: Fri, 30 Nov 2018 14:11:49 -0800 Subject: [PATCH] use #pragma parallel for properly (#68) --- onnxruntime/core/mlas/lib/sgemm.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/onnxruntime/core/mlas/lib/sgemm.cpp b/onnxruntime/core/mlas/lib/sgemm.cpp index 14da273af9..9d69ba6b57 100644 --- a/onnxruntime/core/mlas/lib/sgemm.cpp +++ b/onnxruntime/core/mlas/lib/sgemm.cpp @@ -1288,9 +1288,8 @@ Return Value: #if defined(MLAS_USE_OPENMP) - #pragma omp parallel num_threads(Index) - { - int tid = omp_get_thread_num(); + #pragma omp parallel for + for (int32_t tid = 0; tid < int32_t(Index); tid++) { MLAS_SGEMM_WORK_BLOCK::SEGMENT* Segment = &WorkBlock.Segments[tid];