forked from huawei/mindspore2022
!31628 fix codecheck and runtime num thread default
Merge pull request !31628 from fangzehua/fix_code_0321
This commit is contained in:
commit
6a85204890
|
|
@ -103,7 +103,9 @@ MsContext::MsContext(const std::string &policy, const std::string &target) {
|
|||
set_param<bool>(MS_CTX_ENABLE_RECOVERY, false);
|
||||
|
||||
uint32_t kDefaultRuntimeNumThreads = 30;
|
||||
set_param<uint32_t>(MS_CTX_RUNTIME_NUM_THREADS, kDefaultRuntimeNumThreads);
|
||||
uint32_t cpu_core_num = std::thread::hardware_concurrency() - 1;
|
||||
uint32_t runtime_num_threads_default = std::min(cpu_core_num, kDefaultRuntimeNumThreads);
|
||||
set_param<uint32_t>(MS_CTX_RUNTIME_NUM_THREADS, runtime_num_threads_default);
|
||||
|
||||
backend_policy_ = policy_map_[policy];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue