Unverified Commit 9cd9f1d8 authored by Artur Wojcik's avatar Artur Wojcik Committed by GitHub
Browse files

rename function 'near' to 'within_abs' (#1995)

* rename function 'near' to 'make_near'

* try disabling vega10 machine
parent 8e18544f
......@@ -90,7 +90,7 @@ def rocmnodename(name) {
} else if(name == "mi100+") {
node_name = "${rocmtest_name} && (gfx908 || gfx90a) && !vm";
} else if(name == "cdna") {
node_name = "${rocmtest_name} && (gfx908 || gfx90a || vega) && !vm";
node_name = "${rocmtest_name} && (gfx908 || gfx90a || vega20) && !vm";
} else if(name == "nogpu") {
node_name = "${rocmtest_name} && nogpu";
}
......
......@@ -384,7 +384,7 @@ bool throws(F f, const std::string& msg = "")
}
template <class T, class U>
auto near(T px, U py, double ptol = 1e-6f)
auto within_abs(T px, U py, double ptol = 1e-6f)
{
return make_function("near", [](auto x, auto y, auto tol) { return std::abs(x - y) < tol; })(
px, py, ptol);
......
......@@ -82,9 +82,9 @@ TEST_CASE(generate_module)
auto f = compile_module<float(float, float)>(m);
EXPECT(test::near(f(2, 2), 2));
EXPECT(test::near(f(10, 6), 4));
EXPECT(test::near(f(1, 2), std::sqrt(3)));
EXPECT(test::within_abs(f(2, 2), 2));
EXPECT(test::within_abs(f(10, 6), 4));
EXPECT(test::within_abs(f(1, 2), std::sqrt(3)));
}
TEST_CASE(generate_module_with_literals)
......@@ -99,9 +99,9 @@ TEST_CASE(generate_module_with_literals)
auto f = compile_module<float(float, float)>(m);
EXPECT(test::near(f(1, 2), 2));
EXPECT(test::near(f(9, 6), 4));
EXPECT(test::near(f(0, 2), std::sqrt(3)));
EXPECT(test::within_abs(f(1, 2), 2));
EXPECT(test::within_abs(f(9, 6), 4));
EXPECT(test::within_abs(f(0, 2), std::sqrt(3)));
}
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