aboutsummaryrefslogtreecommitdiff
path: root/verif/generator/tosa_test_gen.py
diff options
context:
space:
mode:
Diffstat (limited to 'verif/generator/tosa_test_gen.py')
-rw-r--r--verif/generator/tosa_test_gen.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/verif/generator/tosa_test_gen.py b/verif/generator/tosa_test_gen.py
index b472087..978e735 100644
--- a/verif/generator/tosa_test_gen.py
+++ b/verif/generator/tosa_test_gen.py
@@ -392,6 +392,12 @@ class TosaTestGen:
compliance_tens["abs_error_info"] = {
"lower_bound": op["compliance"]["abs_error_lower_bound"]
}
+ elif op["op"] in (Op.SIN, Op.COS):
+ mode = gtu.ComplianceMode.ABS_ERROR
+ if "compliance" in op and "abs_error_normal_divisor" in op["compliance"]:
+ compliance_tens["abs_error_info"] = {
+ "normal_divisor": op["compliance"]["abs_error_normal_divisor"]
+ }
else:
mode = gtu.ComplianceMode.EXACT
compliance_tens["mode"] = gtu.ComplianceMode(mode).name
@@ -4036,6 +4042,27 @@ class TosaTestGen:
TosaErrorValidator.evWrongOutputList,
),
},
+ "cos": {
+ "op": Op.COS,
+ "operands": (1, 0),
+ "build_fcn": (
+ build_unary,
+ TosaTensorGen.tgBasic,
+ TosaTensorValuesGen.tvgLazyGenDefault,
+ TosaArgGen.agNone,
+ ),
+ "types": TYPE_FP,
+ "error_if_validators": (
+ TosaErrorValidator.evWrongInputType,
+ TosaErrorValidator.evWrongOutputType,
+ TosaErrorValidator.evWrongInputList,
+ TosaErrorValidator.evWrongOutputList,
+ ),
+ "data_gen": {
+ "fp": (gtu.DataGenType.PSEUDO_RANDOM,),
+ },
+ "compliance": {"abs_error_normal_divisor": 2},
+ },
"exp": {
"op": Op.EXP,
"operands": (1, 0),
@@ -4180,6 +4207,27 @@ class TosaTestGen:
},
"compliance": {"ulp": 2},
},
+ "sin": {
+ "op": Op.SIN,
+ "operands": (1, 0),
+ "build_fcn": (
+ build_unary,
+ TosaTensorGen.tgBasic,
+ TosaTensorValuesGen.tvgLazyGenDefault,
+ TosaArgGen.agNone,
+ ),
+ "types": TYPE_FP,
+ "error_if_validators": (
+ TosaErrorValidator.evWrongInputType,
+ TosaErrorValidator.evWrongOutputType,
+ TosaErrorValidator.evWrongInputList,
+ TosaErrorValidator.evWrongOutputList,
+ ),
+ "data_gen": {
+ "fp": (gtu.DataGenType.PSEUDO_RANDOM,),
+ },
+ "compliance": {"abs_error_normal_divisor": 2},
+ },
# Elementwise Ternary operators
"select": {
"op": Op.SELECT,