From ce1a7d069c1365d43797d779be0d884e523d4f0a Mon Sep 17 00:00:00 2001 From: Eric Kunze Date: Fri, 15 Dec 2023 21:36:38 +0000 Subject: Update conformance tests to use new rescale attributes Determine input/output signed/unsignedness appropriately. Signed-off-by: Eric Kunze Change-Id: I83d95f37803dd9d0ab27be6785523271ad24cf99 --- thirdparty/serialization_lib | 2 +- verif/generator/tosa_test_gen.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/thirdparty/serialization_lib b/thirdparty/serialization_lib index cce787e..e29a1cd 160000 --- a/thirdparty/serialization_lib +++ b/thirdparty/serialization_lib @@ -1 +1 @@ -Subproject commit cce787e55f2f4e9fa14fd4643ddfd34de754c500 +Subproject commit e29a1cd18884185634f6ccf9d5afe070cea96cd9 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) -- cgit v1.2.1