From 736fd1a7e4083153ccc4cf360b44dd07b6788494 Mon Sep 17 00:00:00 2001 From: James Ward Date: Mon, 23 Jan 2023 17:13:37 +0000 Subject: Create MI tests for Type Conversion: CAST * Add exclusion regex's to conformance generation Signed-off-by: James Ward Change-Id: I15bef7451efd5662065060242d35bd7fa3381487 --- verif/generator/tosa_error_if.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'verif/generator/tosa_error_if.py') diff --git a/verif/generator/tosa_error_if.py b/verif/generator/tosa_error_if.py index 40c5d13..93f975d 100644 --- a/verif/generator/tosa_error_if.py +++ b/verif/generator/tosa_error_if.py @@ -314,12 +314,14 @@ class TosaErrorIfArgGen: @staticmethod def eiCastErrorIf(testGen, input_dtype): - if input_dtype in [DType.BOOL, DType.FP16, DType.BF16, DType.FP32]: - outputDType = [DType.BOOL, DType.INT48, DType.FP16, DType.BF16, DType.FP32] + if input_dtype in [DType.BOOL, DType.FP32]: + outputDType = [DType.BOOL, DType.INT48, DType.FP32] + elif input_dtype in [DType.FP16, DType.BF16]: + outputDType = [DType.BOOL, DType.INT48] elif input_dtype in [DType.INT8, DType.INT16, DType.INT32]: outputDType = [DType.INT48] else: - assert True, f"input_dtype ({input_dtype}) not supported" + assert False, f"input_dtype ({input_dtype}) not supported" return outputDType @@ -538,15 +540,24 @@ class TosaErrorValidator: ) or ( input_dtype == DType.FP16 - and output_dtype not in [DType.INT8, DType.INT16, DType.INT32] + and output_dtype + not in [DType.INT8, DType.INT16, DType.INT32, DType.FP32] ) or ( input_dtype == DType.BF16 - and output_dtype not in [DType.INT8, DType.INT16, DType.INT32] + and output_dtype + not in [DType.INT8, DType.INT16, DType.INT32, DType.FP32] ) or ( input_dtype == DType.FP32 - and output_dtype not in [DType.INT8, DType.INT16, DType.INT32] + and output_dtype + not in [ + DType.INT8, + DType.INT16, + DType.INT32, + DType.FP16, + DType.BF16, + ] ) ): error_result = True -- cgit v1.2.1