未验证 提交 9f666615 编写于 作者: W Wilber 提交者: GitHub

c++ support read flags from env (#47223)

上级 c5fe109b
......@@ -1367,6 +1367,17 @@ CreatePaddlePredictor<AnalysisConfig, PaddleEngineKind::kAnalysis>(
process_level_allocator_enabled = true;
}
// support set flags from enviorment.
const platform::ExportedFlagInfoMap &env_map =
platform::GetExportedFlagInfoMap();
std::ostringstream os;
os << "--tryfromenv=";
for (auto &pair : env_map) {
os << pair.second.name << ",";
}
auto tryfromenv_str = os.str();
gflags.push_back(os.str().substr(0, tryfromenv_str.size() - 1));
if (framework::InitGflags(gflags)) {
VLOG(3) << "The following gpu analysis configurations only take effect "
"for the first predictor: ";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册