aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/verify/verify_utils.cc
diff options
context:
space:
mode:
authorJeremy Johnson <jeremy.johnson@arm.com>2024-01-03 10:54:12 +0000
committerEric Kunze <eric.kunze@arm.com>2024-01-08 21:40:41 +0000
commitd80ea5e11e5f92e0f7c08afeba74cb7d1719987b (patch)
tree25589c928c95de3de8bbad96dc07432bd9d289f9 /reference_model/src/verify/verify_utils.cc
parent2936f13d0e26c394333495ce909740eaf58a45cc (diff)
downloadreference_model-d80ea5e11e5f92e0f7c08afeba74cb7d1719987b.tar.gz
Main Conformance: Re-adjust TANH compliance check
Add lower bound to ABS ERROR checks to allow for cancellation of small values in error bounds checking. Re-adjust the error bounds multiplier to match the specification. Fix up naming of verify library info structs. Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: I3e178c3d7d59fef9c3696178646b23ed2a3ffc61
Diffstat (limited to 'reference_model/src/verify/verify_utils.cc')
-rw-r--r--reference_model/src/verify/verify_utils.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/reference_model/src/verify/verify_utils.cc b/reference_model/src/verify/verify_utils.cc
index 3bdc99f..5ce646c 100644
--- a/reference_model/src/verify/verify_utils.cc
+++ b/reference_model/src/verify/verify_utils.cc
@@ -1,5 +1,5 @@
-// Copyright (c) 2023, ARM Limited.
+// Copyright (c) 2023-2024, ARM Limited.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM(VerifyMode,
{ VerifyMode::AbsError, "ABS_ERROR" },
})
-void from_json(const nlohmann::json& j, UlpInfo& ulpInfo)
+void from_json(const nlohmann::json& j, UlpVerifyInfo& ulpInfo)
{
j.at("ulp").get_to(ulpInfo.ulp);
}
@@ -70,6 +70,14 @@ void from_json(const nlohmann::json& j, ReduceProductVerifyInfo& reduceProduceIn
j.at("n").get_to(reduceProduceInfo.n);
}
+void from_json(const nlohmann::json& j, AbsErrorVerifyInfo& absErrorInfo)
+{
+ if (j.contains("lower_bound"))
+ {
+ j.at("lower_bound").get_to(absErrorInfo.lowerBound);
+ }
+}
+
void from_json(const nlohmann::json& j, VerifyConfig& cfg)
{
j.at("mode").get_to(cfg.mode);
@@ -86,6 +94,12 @@ void from_json(const nlohmann::json& j, VerifyConfig& cfg)
{
j.at("reduce_product_info").get_to(cfg.reduceProductInfo);
}
+ // Set up defaults for optional AbsErrorVerifyInfo
+ cfg.absErrorInfo.lowerBound = 0;
+ if (j.contains("abs_error_info"))
+ {
+ j.at("abs_error_info").get_to(cfg.absErrorInfo);
+ }
}
std::optional<VerifyConfig> parseVerifyConfig(const char* tensorName, const char* json)