From 32d0b5af61d978d9932ac5576b42203e57881168 Mon Sep 17 00:00:00 2001 From: Jeremy Johnson Date: Thu, 1 Feb 2024 15:54:07 +0000 Subject: Main Compliance: Add RESIZE support Add RELATIVE verify mode for RESIZE. Signed-off-by: Jeremy Johnson Change-Id: I4fe352579507211dae7a048bf080c24426ce42a2 --- reference_model/src/verify/verify_utils.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'reference_model/src/verify/verify_utils.cc') diff --git a/reference_model/src/verify/verify_utils.cc b/reference_model/src/verify/verify_utils.cc index abb55eb..14bc6f1 100644 --- a/reference_model/src/verify/verify_utils.cc +++ b/reference_model/src/verify/verify_utils.cc @@ -52,6 +52,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM(VerifyMode, { VerifyMode::FpSpecial, "FP_SPECIAL" }, { VerifyMode::ReduceProduct, "REDUCE_PRODUCT" }, { VerifyMode::AbsError, "ABS_ERROR" }, + { VerifyMode::Relative, "RELATIVE" }, }) void from_json(const nlohmann::json& j, UlpVerifyInfo& ulpInfo) @@ -78,6 +79,12 @@ void from_json(const nlohmann::json& j, AbsErrorVerifyInfo& absErrorInfo) } } +void from_json(const nlohmann::json& j, RelativeVerifyInfo& rInfo) +{ + j.at("max").get_to(rInfo.max); + j.at("scale").get_to(rInfo.scale); +} + void from_json(const nlohmann::json& j, VerifyConfig& cfg) { j.at("mode").get_to(cfg.mode); @@ -100,6 +107,10 @@ void from_json(const nlohmann::json& j, VerifyConfig& cfg) { j.at("abs_error_info").get_to(cfg.absErrorInfo); } + if (j.contains("relative_info")) + { + j.at("relative_info").get_to(cfg.relativeInfo); + } } std::optional parseVerifyConfig(const char* tensorName, const char* json) -- cgit v1.2.1