Commit 089515ea authored by Shucai Xiao's avatar Shucai Xiao
Browse files

refine code for fp_convert test cases.

parent 70f793b4
......@@ -1571,27 +1571,20 @@ TEST_CASE(fp32_fp16_test)
return p;
};
auto test_case = [&](std::vector<std::string>&& op_names)
{
std::vector<float> gold_res = {2.0, 4.0, 6.0, 8.0, 10.0, 12.0};
auto p = create_program();
migraphx::quantize(p, {"all"});
migraphx::quantize(p, op_names);
p.compile(migraphx::cpu::target{});
auto result = p.eval({});
std::vector<float> res;
result.visit([&](auto output) { res.assign(output.begin(), output.end()); });
EXPECT(migraphx::verify_range(res, gold_res));
}
};
{
std::vector<float> gold_res = {2.0, 4.0, 6.0, 8.0, 10.0, 12.0};
auto p = create_program();
migraphx::quantize(p, {"all"});
p.compile(migraphx::cpu::target{});
auto result = p.eval({});
std::vector<float> res;
result.visit([&](auto output) { res.assign(output.begin(), output.end()); });
EXPECT(migraphx::verify_range(res, gold_res));
}
test_case({"all"});
test_case({"add"});
}
int main(int argc, const char* argv[]) { test::run(argc, argv); }
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