提交 d2e33af5 编写于 作者: M Megvii Engine Team

fix(mgb): fix wrong set of strategy in lar

GitOrigin-RevId: 5c1f7c669fa94ad9b1a4d46cfc8ed101b16d98a4
上级 8b7d8d29
......@@ -703,7 +703,7 @@ void run_test_st(Args &env) {
mgb::gopt::set_opr_algo_workspace_limit_inplace(vars, env.workspace_limit);
using S = opr::mixin::AlgoChooserHelper::ExecutionPolicy::Strategy;
S strategy = S::HEURISTIC;
S strategy = static_cast<S>(0);
if (env.reproducible) {
strategy = S::REPRODUCIBLE;
}
......
......@@ -868,6 +868,23 @@ template <typename Opr>
typename AlgoChooser<Opr>::ImplExecutionPolicy AlgoChooser<Opr>::get_policy(
const AlgoChooserHelper& helper) {
auto opr_strategy = helper.execution_policy().strategy;
auto strategy2str = [](auto strategy) {
std::string ret;
if (strategy & ExecutionStrategy::HEURISTIC) {
ret += "HEURISTIC ";
}
if (strategy & ExecutionStrategy::PROFILE) {
ret += "PROFILE ";
}
if (strategy & ExecutionStrategy::REPRODUCIBLE) {
ret += "REPRODUCIBLE ";
}
if (strategy & ExecutionStrategy::OPTIMIZED) {
ret += "OPTIMIZED ";
}
return ret;
};
mgb_log_debug("Use Stragegy :%s", strategy2str(opr_strategy).c_str());
if (opr_strategy & ExecutionStrategy::HEURISTIC) {
if (opr_strategy & ExecutionStrategy::PROFILE) {
//! this strategy will choose from cache first, then choost by
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册