From 0bbd8bcfb20ec834f18d0bb89fc69ba4e92b3019 Mon Sep 17 00:00:00 2001 From: Jeremy Johnson Date: Thu, 9 Nov 2023 16:56:07 +0000 Subject: Main Compliance testing support for LOG and ACTIVATIONs Increase exp2 allowed range to account for denormals. Minor adjustments to verify to match spec updates for pseudo code. Set ranges of activation function inputs to match spec. Signed-off-by: Jeremy Johnson Change-Id: I6fcf665932ac2c9080e284b865da8f7746801f59 --- reference_model/src/verify/verify_ulp.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'reference_model/src/verify/verify_ulp.cc') diff --git a/reference_model/src/verify/verify_ulp.cc b/reference_model/src/verify/verify_ulp.cc index b333810..6e78b96 100644 --- a/reference_model/src/verify/verify_ulp.cc +++ b/reference_model/src/verify/verify_ulp.cc @@ -30,15 +30,8 @@ bool tosaCheckULP(float testValue, double referenceValue, double ulpNum) double errorBound = 0.0; if (std::isfinite(referenceValue) && std::abs(referenceValue) != 0.0) { - // Make the sign of the reference value positive - // and adjust the test value appropriately. - if (referenceValue < 0) - { - referenceValue = -referenceValue; - testValue = -testValue; - } // Find the exponent of the reference value. - int32_t referenceExponent = ilog2(referenceValue); + int32_t referenceExponent = ilog2(std::abs(referenceValue)); // Work out the values magnitude - by raising 2 to the power of the // exponent and taking the normalized minimum for denormal values -- cgit v1.2.1