aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/main.cpp
diff options
context:
space:
mode:
authorJeremy Johnson <jeremy.johnson@arm.com>2023-11-07 16:27:35 +0000
committerEric Kunze <eric.kunze@arm.com>2023-11-16 21:24:23 +0000
commit9a758384d1066ade713311940f3d15c860f90866 (patch)
treec25c9624b7c1d589d0648d6b3b4e6333f87a7712 /reference_model/src/main.cpp
parent2d70ac4c02808609feb357488dcd080bd6fc5ba5 (diff)
downloadreference_model-9a758384d1066ade713311940f3d15c860f90866.tar.gz
Main Compliance testing support for EXP & POW
Added new ABS_ERROR mode to verify lib and ref model. Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: Ifb78290675833d3df7df91a4d6cef336b02b64a4
Diffstat (limited to 'reference_model/src/main.cpp')
-rw-r--r--reference_model/src/main.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/reference_model/src/main.cpp b/reference_model/src/main.cpp
index 6970bb1..80125ee 100644
--- a/reference_model/src/main.cpp
+++ b/reference_model/src/main.cpp
@@ -41,7 +41,7 @@ int writeVariableTensors(SubgraphTraverser& gt, json test_desc);
int loadGraph(TosaSerializationHandler& tsh, json& test_desc);
void parse_value(const std::string& text, tosa_level_t& value);
const std::string getResultFilenamePrefix();
-bool isComplianceModeDotProduct(json& test_desc);
+bool isComplianceAbsModeNeeded(json& test_desc);
int main(int argc, char** argv)
{
@@ -90,10 +90,10 @@ int main(int argc, char** argv)
GraphStatus status = GraphStatus::TOSA_VALID;
- if (isComplianceModeDotProduct(test_desc) && !g_func_config.precise_mode)
+ if (isComplianceAbsModeNeeded(test_desc) && !g_func_config.precise_mode)
{
- // Warn about precise mode for dot product compliance
- DEBUG_INFO(CONFIG, "DOT_PRODUCT compliance: NOTE - enable precise mode for compliance results")
+ // Warn about precise mode for dot product or abs error compliance
+ DEBUG_INFO(CONFIG, "DOT_PRODUCT/ABS_ERROR compliance: NOTE - enable precise mode for compliance results")
}
// max of 2 runs, second run only happens when precise_mode is set, to do an abs_mode run
@@ -220,10 +220,10 @@ int main(int argc, char** argv)
}
if (run == 0 && status == GraphStatus::TOSA_VALID && g_func_config.precise_mode && g_func_config.eval &&
- isComplianceModeDotProduct(test_desc))
+ isComplianceAbsModeNeeded(test_desc))
{
- // first run result is valid and precise mode and eval is true: turn on abs_mode for second run
- DEBUG_INFO(CONFIG, "DOT_PRODUCT compliance: Evaluating the graph again to produce bounds results")
+ // when first run result is valid and precise mode and eval is true: turn on abs_mode for second run
+ DEBUG_INFO(CONFIG, "DOT_PRODUCT/ABS_ERROR compliance: Evaluating the graph again to produce bounds results")
g_func_config.abs_mode = true;
continue;
}
@@ -361,17 +361,17 @@ const std::string getResultFilenamePrefix()
return g_func_config.abs_mode ? "bounds_" : "";
}
-// returns true iff test_desc contains a "meta" object containing a "compliance"
+// returns true if test_desc contains a "meta" object containing a "compliance"
// object which contains "tensors" and one of those has a "mode" whose value is
-// "DOT_PRODUCT"
-bool isComplianceModeDotProduct(json& test_desc)
+// "DOT_PRODUCT" or "ABS_ERROR"
+bool isComplianceAbsModeNeeded(json& test_desc)
{
if (test_desc.contains("meta") && test_desc["meta"].contains("compliance") &&
test_desc["meta"]["compliance"].contains("tensors"))
{
for (auto t : test_desc["meta"]["compliance"]["tensors"])
{
- if (t.contains("mode") && t["mode"] == "DOT_PRODUCT")
+ if (t.contains("mode") && (t["mode"] == "DOT_PRODUCT" || t["mode"] == "ABS_ERROR"))
{
return true;
}