[CPU] Use parallel_nt_static for MLAS threading (#19297)

This commit is contained in:
Zhang Yi
2023-08-22 18:38:07 +08:00
committed by GitHub
parent 7df8d1ca2d
commit 7e724565b5

View File

@@ -21,7 +21,7 @@ size_t OVMlasThreadPool::DegreeOfParallelism() {
}
void OVMlasThreadPool::TrySimpleParallelFor(const std::ptrdiff_t total, const std::function<void(std::ptrdiff_t)>& fn) {
ov::parallel_nt(threadNum, [&](const size_t ithr, const size_t nthr) {
ov::parallel_nt_static(threadNum, [&](const size_t ithr, const size_t nthr) {
std::ptrdiff_t start = 0, end = 0;
ov::splitter(total, nthr, ithr, start, end);
for (std::ptrdiff_t i = start; i < end; i++) {