"src/targets/vscode:/vscode.git/clone" did not exist on "b72f2b9ec2a0ce61bbbb577e92ae68c35dc56eaf"
Commit 41e3b9f6 authored by Ted Themistokleous's avatar Ted Themistokleous
Browse files

fixup! Add support for division by zero errors

parent c2d4ceb0
......@@ -41,6 +41,8 @@
namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_TRACE_PASSES);
auto lit_broadcast() { return match::any_of(match::is_constant(), match::name("broadcast")); }
auto not_lit_broadcast() { return match::none_of(match::is_constant(), match::name("broadcast")); }
auto op_lit_broadcast(std::string op, std::string x, std::string y)
......@@ -857,9 +859,12 @@ struct find_zero_div_const
void apply [[noreturn]] (const module& m, const match::matcher_result& r) const
{
m.debug_print();
std::cout << "ERROR:DIV_BY_ZERO: ";
m.debug_print(r.result);
if(enabled(MIGRAPHX_TRACE_PASSES{}))
{
m.debug_print();
std::cout << "ERROR:DIV_BY_ZERO: ";
m.debug_print(r.result);
}
MIGRAPHX_THROW("ERROR: Matched division by zero in pass");
}
};
......
......@@ -906,7 +906,7 @@ TEST_CASE(simplify_div_zero_const)
}
catch(const std::runtime_error& e)
{
std::cerr << e.what() << std::endl;
(void)e;
result = true;
}
EXPECT(result);
......
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