From d5e36f5a462cd70d6a4a15da7577818f00324bd6 Mon Sep 17 00:00:00 2001 From: zhoufeng Date: Tue, 6 Jul 2021 21:10:24 +0800 Subject: [PATCH] fix empty lic Signed-off-by: zhoufeng --- mindspore/ccsrc/runtime/device/ascend/lic_manager.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mindspore/ccsrc/runtime/device/ascend/lic_manager.cc b/mindspore/ccsrc/runtime/device/ascend/lic_manager.cc index 50e4c6a7d27..9acf9dcea90 100644 --- a/mindspore/ccsrc/runtime/device/ascend/lic_manager.cc +++ b/mindspore/ccsrc/runtime/device/ascend/lic_manager.cc @@ -98,25 +98,25 @@ void LicManager::ParseSwitch() { } void LicManager::ParseFeSwitch(const std::map &options_map) { + // no fe switch, open all auto options_iter = options_map.find(kFeKey); if (options_iter == options_map.end()) { return; } - const auto &options_str = options_iter->second; - // invalid options, do nothing. - if (options_str.empty()) { - return; - } // "All" in options means all open, do nothing. + const auto &options_str = options_iter->second; if (options_str.find(kAllOpen) != std::string::npos) { return; } + // close all first for (auto iter = kPassCodeMap.begin(); iter != kPassCodeMap.end(); ++iter) { auto pass = iter->second; pass_switch_.emplace(pass, false); } + + // then open passes in options auto fe_pass = SplitStrByRegex(options_str, ":"); for (auto &pass_code : fe_pass) { auto iter = kPassCodeMap.find(pass_code);