mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Fix build break for microbench. (#4960)
This commit is contained in:
parent
14b51d6502
commit
cf1b74396a
1 changed files with 3 additions and 3 deletions
|
|
@ -110,11 +110,11 @@ static void BM_SimpleScheduleWait(benchmark::State& state) {
|
|||
tpo.auto_set_affinity = true;
|
||||
tpo.thread_pool_size = 0;
|
||||
std::unique_ptr<concurrency::ThreadPool> tp(concurrency::CreateThreadPool(&onnxruntime::Env::Default(), tpo, ThreadPoolType::INTRA_OP));
|
||||
size_t threads = tp->NumThreads();
|
||||
std::ptrdiff_t threads = concurrency::ThreadPool::DegreeOfParallelism(tp.get());
|
||||
|
||||
for (auto _ : state) {
|
||||
onnxruntime::Barrier barrier(static_cast<unsigned int>(threads));
|
||||
for (std::ptrdiff_t id = 0; id < static_cast<std::ptrdiff_t>(threads); ++id) {
|
||||
for (std::ptrdiff_t id = 0; id < threads; ++id) {
|
||||
tp->Schedule([id, threads, len, &barrier]() {
|
||||
std::ptrdiff_t start, work_remaining;
|
||||
TestPartitionWork(id, threads, len, &start, &work_remaining);
|
||||
|
|
@ -182,4 +182,4 @@ BENCHMARK(BM_SimpleScheduleWaitWindowsTP)
|
|||
->Arg(160000)
|
||||
->Arg(320000)
|
||||
->Arg(640000);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue