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

rename error to rms_error

parent ba9361c8
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "verify.hpp" #include "verify.hpp"
#include "migraphx/verify.hpp"
#include "perf.hpp" #include "perf.hpp"
#include <migraphx/register_target.hpp> #include <migraphx/register_target.hpp>
......
...@@ -244,26 +244,26 @@ template <class R1, class R2> ...@@ -244,26 +244,26 @@ template <class R1, class R2>
bool verify_range(const R1& r1, bool verify_range(const R1& r1,
const R2& r2, const R2& r2,
std::size_t tolerance = 80, std::size_t tolerance = 80,
double* out_error = nullptr) double* out_rms_error = nullptr)
{ {
double threshold = get_rms_tol(r1, tolerance); double threshold = get_rms_tol(r1, tolerance);
auto error = rms_range(r1, r2); auto error = rms_range(r1, r2);
if(out_error != nullptr) if(out_rms_error != nullptr)
*out_error = error; *out_rms_error = error;
return error <= threshold; return error <= threshold;
} }
template <class R1, class R2> template <class R1, class R2>
bool verify_range_with_tolerance(const R1& r1, bool verify_range_with_tolerance(const R1& r1,
const expected<R2>& r2, const expected<R2>& r2,
tolerance tols = tolerance{}, tolerance tols = tolerance{},
double* out_error = nullptr) double* out_rms_error = nullptr)
{ {
auto rms_error = rms_range(r1, r2.data()); auto rms_error = rms_range(r1, r2.data());
// disable ewise_verify for now, it requires lot of tests to be fixed // disable ewise_verify for now, it requires lot of tests to be fixed
// auto ewise_verify = allclose(r1, r2.data(), tols); // auto ewise_verify = allclose(r1, r2.data(), tols);
if(out_error != nullptr) if(out_rms_error != nullptr)
*out_error = rms_error; *out_rms_error = rms_error;
return rms_error <= tols.rms_tol; return rms_error <= tols.rms_tol;
} }
...@@ -272,10 +272,10 @@ bool verify_range_with_tolerance(const R1& r1, ...@@ -272,10 +272,10 @@ bool verify_range_with_tolerance(const R1& r1,
template <class R1, class R2> template <class R1, class R2>
bool verify_range_with_tolerance(const expected<R1>& r1, bool verify_range_with_tolerance(const expected<R1>& r1,
const R2& r2, const R2& r2,
tolerance tols = tolerance{}, tolerance tols = tolerance{},
double* out_error = nullptr) double* out_rms_error = nullptr)
{ {
return verify_range(r2, r1, tols, out_error); return verify_range(r2, r1, tols, out_rms_error);
} }
} // namespace verify } // namespace verify
......
...@@ -34,13 +34,14 @@ bool verify_args_with_threshold(const std::string& name, ...@@ -34,13 +34,14 @@ bool verify_args_with_threshold(const std::string& name,
{ {
bool passed = true; bool passed = true;
visit_all(ref_arg, target_arg)([&](auto ref, auto target) { visit_all(ref_arg, target_arg)([&](auto ref, auto target) {
double error; double rms_error;
passed = verify::verify_range_with_tolerance(target, verify::expected{ref}, tols, &error); passed =
verify::verify_range_with_tolerance(target, verify::expected{ref}, tols, &rms_error);
if(not passed) if(not passed)
{ {
// TODO: Check for nans // TODO: Check for nans
std::cout << "FAILED: " << name << std::endl; std::cout << "FAILED: " << name << std::endl;
std::cout << "error: " << error << std::endl; std::cout << "RMS Error: " << rms_error << std::endl;
if(ref.size() < 32) if(ref.size() < 32)
std::cout << "ref:" << ref << std::endl; std::cout << "ref:" << ref << std::endl;
if(target.size() < 32) if(target.size() < 32)
......
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