Commit d505eecb authored by Umang Yadav's avatar Umang Yadav
Browse files

mark constructor as explicit

parent 2e9e34a1
...@@ -84,7 +84,7 @@ void verify_program(const std::string& name, ...@@ -84,7 +84,7 @@ void verify_program(const std::string& name,
std::size_t output_num = ref_outs.size(); std::size_t output_num = ref_outs.size();
for(std::size_t i = 0; i < output_num; ++i) for(std::size_t i = 0; i < output_num; ++i)
{ {
verify_args_with_threshold(name, target_outs[i], ref_outs[i], tols); verify_args_with_threshold(name, target_outs[i], verify::expected{ref_outs[i]}, tols);
} }
} }
......
...@@ -203,7 +203,7 @@ template <class T> ...@@ -203,7 +203,7 @@ template <class T>
struct expected struct expected
{ {
expected() = default; expected() = default;
expected(const T& input) : x(&input) {} explicit expected(const T& input) : x(&input) {}
const T& data() const const T& data() const
{ {
assert(x != nullptr); assert(x != nullptr);
......
...@@ -133,7 +133,8 @@ bool verify_mlir(const migraphx::module& mmlir) ...@@ -133,7 +133,8 @@ bool verify_mlir(const migraphx::module& mmlir)
auto inputs = generate_params(ref); auto inputs = generate_params(ref);
auto mlir = create_program_from_mlir(mmlir); auto mlir = create_program_from_mlir(mmlir);
return migraphx::verify_args("mlir", run_gpu(mlir, inputs), run_ref(ref, inputs)); return migraphx::verify_args(
"mlir", run_gpu(mlir, inputs), migraphx::verify::expected{run_ref(ref, inputs)});
} }
TEST_CASE(conv) TEST_CASE(conv)
......
...@@ -251,7 +251,8 @@ void run_verify::verify(const std::string& name, ...@@ -251,7 +251,8 @@ void run_verify::verify(const std::string& name,
std::size_t num = gold.size(); std::size_t num = gold.size();
for(std::size_t i = 0; ((i < num) and passed); ++i) for(std::size_t i = 0; ((i < num) and passed); ++i)
{ {
passed &= migraphx::verify_args(tname, result[i], gold[i]); passed &=
migraphx::verify_args(tname, result[i], migraphx::verify::expected{gold[i]});
} }
if(not passed or migraphx::enabled(MIGRAPHX_TRACE_TEST{})) if(not passed or migraphx::enabled(MIGRAPHX_TRACE_TEST{}))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment