diff options
author | Jeremy Johnson <jeremy.johnson@arm.com> | 2023-10-24 14:45:12 +0100 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2023-10-25 17:47:09 +0000 |
commit | fc5e34e41afc07ea5ed03e3c5d4b5be92bef7fd7 (patch) | |
tree | cbb2556e96ddf1e53dff888e54e76586f46e00fc /reference_model/src/verify/verify_ulp.cc | |
parent | fd8c8fe887d49223b4d4c66d38e79d6e4c648fef (diff) | |
download | reference_model-fc5e34e41afc07ea5ed03e3c5d4b5be92bef7fd7.tar.gz |
Improve verfiy and generate library validation
Improved libraries validation to catch unknown values.
Improved verify output to match generate library.
Refactored generate tests to use less code duplication.
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Change-Id: I9c38745fbc8e70f46c19ddae6c62ee248d33b5f1
Diffstat (limited to 'reference_model/src/verify/verify_ulp.cc')
-rw-r--r-- | reference_model/src/verify/verify_ulp.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/reference_model/src/verify/verify_ulp.cc b/reference_model/src/verify/verify_ulp.cc index 223bc48..486c0ff 100644 --- a/reference_model/src/verify/verify_ulp.cc +++ b/reference_model/src/verify/verify_ulp.cc @@ -124,28 +124,28 @@ bool tosaCheckULP(float testValue, double referenceValue, int64_t ulpCount) bool verifyULP(const CTensor* referenceTensor, const CTensor* implementationTensor, uint64_t ulp) { // Validate that tensors are provided - TOSA_REF_REQUIRE(referenceTensor != nullptr, "reference tensor is missing"); - TOSA_REF_REQUIRE(implementationTensor != nullptr, "implementation tensor is missing"); + TOSA_REF_REQUIRE(referenceTensor != nullptr, "[ULP] Reference tensor is missing"); + TOSA_REF_REQUIRE(implementationTensor != nullptr, "[ULP] Implementation tensor is missing"); // Get number of elements const auto elementCount = numElements(std::vector<int32_t>(referenceTensor->shape, referenceTensor->shape + referenceTensor->num_dims)); - TOSA_REF_REQUIRE(elementCount > 0, "invalid shape for reference tensor"); + TOSA_REF_REQUIRE(elementCount > 0, "[ULP] Invalid shape for reference tensor"); switch (implementationTensor->data_type) { case tosa_datatype_fp32_t: { const auto* refData = reinterpret_cast<const float*>(referenceTensor->data); - TOSA_REF_REQUIRE(refData != nullptr, "missing data for reference"); + TOSA_REF_REQUIRE(refData != nullptr, "[ULP] Missing data for reference"); const auto* impData = reinterpret_cast<const float*>(implementationTensor->data); - TOSA_REF_REQUIRE(impData != nullptr, "missing data for implementation"); + TOSA_REF_REQUIRE(impData != nullptr, "[ULP] Missing data for implementation"); return std::equal(refData, std::next(refData, elementCount), impData, std::next(impData, elementCount), [ulp](const auto& referenceValue, const auto& implementationValue) { return tosaCheckULP(referenceValue, implementationValue, ulp); }); } default: - WARNING("tosa verifier: data-type not supported."); + WARNING("[Verifier][ULP] Data-type not supported."); break; } |