Browse Source

fix SASS cu111

GitOrigin-RevId: cb075ad154
tags/v1.3.0
Megvii Engine Team 4 years ago
parent
commit
1c01128ff5
2 changed files with 16 additions and 1 deletions
  1. +15
    -1
      dnn/test/common/checker.cpp
  2. +1
    -0
      dnn/test/common/checker.h

+ 15
- 1
dnn/test/common/checker.cpp View File

@@ -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,
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);


+ 1
- 0
dnn/test/common/checker.h View File

@@ -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
* *


Loading…
Cancel
Save