forked from mindspore-Ecosystem/mindspore
!40957 Disable async backend init by default
Merge pull request !40957 from hewei/fix_master1
This commit is contained in:
commit
9772a743af
|
@ -497,9 +497,10 @@ compile::BackendPtr Resource::GetBackend() const {
|
|||
}
|
||||
|
||||
void Resource::SetBackendAsync(std::function<compile::BackendPtr()> func) {
|
||||
static bool is_enable_ge = (common::GetEnv("MS_ENABLE_GE") == "1");
|
||||
if (is_enable_ge) {
|
||||
// Disable async backend creating for GE pipeline.
|
||||
static const bool is_enable_async = (common::GetEnv("MS_DEV_ASYNC_BACKEND_INIT") == "1");
|
||||
static const bool is_enable_ge = (common::GetEnv("MS_ENABLE_GE") == "1");
|
||||
if (!is_enable_async || is_enable_ge) {
|
||||
// Disable async backend init if required.
|
||||
std::lock_guard<std::mutex> guard(GetBackendInitMutex());
|
||||
backend_ = func();
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue