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

fix SASS cu111

GitOrigin-RevId: cb075ad15412ceccdb18a0d23acb6c0581b05e3d
上级 58c8746e
...@@ -273,10 +273,20 @@ namespace { ...@@ -273,10 +273,20 @@ namespace {
} }
CheckerHelper::CheckerHelper(Handle *handle, bool check_dispatch): CheckerHelper::CheckerHelper(Handle *handle, bool check_dispatch):
m_handle_naive(create_cpu_handle(2, check_dispatch)),
m_handle_cur(handle), m_handle_cur(handle),
m_default_rng(new NormalRNG()) m_default_rng(new NormalRNG())
{ {
//! set MGB_NO_NAIVE_CHECK=1 to close megdnn test check with naive
const char* env_p = std::getenv("MGB_NO_NAIVE_CHECK");
if (env_p) {
int no_naive_flag = atoi(env_p);
no_naive_and_check = no_naive_flag > 0 ? true : false;
check_dispatch = false;
} else {
no_naive_and_check = false;
}
auto tmp_handle = create_cpu_handle(2, check_dispatch);
m_handle_naive = std::move(tmp_handle);
} }
CheckerHelper::~CheckerHelper() noexcept = default; CheckerHelper::~CheckerHelper() noexcept = default;
...@@ -370,6 +380,10 @@ void CheckerHelper::do_exec(const TensorLayoutArray &user_layouts, ...@@ -370,6 +380,10 @@ void CheckerHelper::do_exec(const TensorLayoutArray &user_layouts,
m_expect_exec_fail = {}; m_expect_exec_fail = {};
return; return;
} }
if (no_naive_and_check){
m_prev_succ = !::testing::Test::HasFailure();
return;
}
exec_naive(tensors_naive); exec_naive(tensors_naive);
if (m_extra_opr_impl) { if (m_extra_opr_impl) {
m_extra_opr_impl(*tensors_extra_opr_impl); m_extra_opr_impl(*tensors_extra_opr_impl);
......
...@@ -75,6 +75,7 @@ protected: ...@@ -75,6 +75,7 @@ protected:
ExtraOprImpl m_extra_opr_impl; ExtraOprImpl m_extra_opr_impl;
OutputCanonizer m_output_canonizer; OutputCanonizer m_output_canonizer;
TensorsConstriant m_tensor_constraint; TensorsConstriant m_tensor_constraint;
bool no_naive_and_check = false;
/** /**
* the offset from the start of malloc memory * the offset from the start of malloc memory
* *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册