aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2023-12-15 21:36:38 +0000
committerEric Kunze <eric.kunze@arm.com>2023-12-15 21:37:49 +0000
commitce1a7d069c1365d43797d779be0d884e523d4f0a (patch)
tree9977c6a03da94481124ff0e5eb8a9cc3954c989b
parent984fe4853d04224d2e88ff10f2bc08b38ef4d025 (diff)
downloadreference_model-ce1a7d069c1365d43797d779be0d884e523d4f0a.tar.gz
Update conformance tests to use new rescale attributes
Determine input/output signed/unsignedness appropriately. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I83d95f37803dd9d0ab27be6785523271ad24cf99
m---------thirdparty/serialization_lib0
-rw-r--r--verif/generator/tosa_test_gen.py9
2 files changed, 9 insertions, 0 deletions
diff --git a/thirdparty/serialization_lib b/thirdparty/serialization_lib
-Subproject cce787e55f2f4e9fa14fd4643ddfd34de754c50
+Subproject e29a1cd18884185634f6ccf9d5afe070cea96cd
diff --git a/verif/generator/tosa_test_gen.py b/verif/generator/tosa_test_gen.py
index 3f6c96f..a94833e 100644
--- a/verif/generator/tosa_test_gen.py
+++ b/verif/generator/tosa_test_gen.py
@@ -1775,12 +1775,16 @@ class TosaTestGen:
in_type_width = self.typeWidth(val.dtype)
out_type_width = self.typeWidth(out_dtype)
+ input_unsigned = False
+ output_unsigned = False
+
if val.dtype == DType.INT8:
input_zp = self.randInt(-128, 128)
in_type_width += 1
elif val.dtype == DType.UINT8:
input_zp = self.randInt(0, 256)
in_type_width += 1
+ input_unsigned = True
elif error_name in [
ErrorIf.InputZeroPointNotZero,
ErrorIf.U16InputZeroPointNotValid,
@@ -1793,6 +1797,7 @@ class TosaTestGen:
# Must come after ErrorIf.U16InputZeroPointNotValid check
input_zp = self.rng.choice([0, 32768])
in_type_width += 1
+ input_unsigned = True
else:
input_zp = 0
@@ -1802,6 +1807,7 @@ class TosaTestGen:
elif out_dtype == DType.UINT8:
output_zp = self.randInt(0, 256)
out_type_width += 1
+ output_unsigned = True
elif error_name in [
ErrorIf.OutputZeroPointNotZero,
ErrorIf.U16OutputZeroPointNotValid,
@@ -1814,6 +1820,7 @@ class TosaTestGen:
# Must come after ErrorIf.U16OutputZeroPointNotValid check
output_zp = self.rng.choice([0, 32768])
out_type_width += 1
+ output_unsigned = True
else:
output_zp = 0
@@ -1902,6 +1909,8 @@ class TosaTestGen:
scale32,
double_round,
per_channel,
+ input_unsigned,
+ output_unsigned,
)
self.ser.addOperator(op["op"], input_list, output_list, attr)