mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-26 22:35:43 +00:00
Add zero size check before setting thread pool so that the zero default value won't cause a failure. (#1109)
This commit is contained in:
parent
f6df36b68b
commit
8808efd9e3
1 changed files with 3 additions and 1 deletions
|
|
@ -79,7 +79,9 @@ OnnxRuntimeTestSession::OnnxRuntimeTestSession(Ort::Env& env, std::random_device
|
|||
else
|
||||
session_options.DisableSequentialExecution();
|
||||
fprintf(stdout, "Setting thread pool size to %d\n", performance_test_config.run_config.session_thread_pool_size);
|
||||
session_options.SetThreadPoolSize(performance_test_config.run_config.session_thread_pool_size);
|
||||
// Don't set the thread pool size unless it has been changed from our zero default value (as zero will fail)
|
||||
if (performance_test_config.run_config.session_thread_pool_size != 0)
|
||||
session_options.SetThreadPoolSize(performance_test_config.run_config.session_thread_pool_size);
|
||||
// Set optimization level.
|
||||
session_options.SetGraphOptimizationLevel(performance_test_config.run_config.optimization_level);
|
||||
if (!performance_test_config.run_config.profile_file.empty())
|
||||
|
|
|
|||
Loading…
Reference in a new issue