diff options
author | Jeremy Johnson <jeremy.johnson@arm.com> | 2023-11-20 16:15:30 +0000 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2023-11-30 18:52:24 +0000 |
commit | 3047625f7d4b3a77cb3a3480481122f7ba01be2d (patch) | |
tree | 125ce52f1b9f65090a0bdb1c2fafeb8e0c516425 /verif/conformance/test_select.py | |
parent | 35a3aa994cf18f735193a05a7eb2c61d497233d2 (diff) | |
download | reference_model-3047625f7d4b3a77cb3a3480481122f7ba01be2d.tar.gz |
Adjust random data ranges for Main Compliance to avoid FP inf and nan
POW - there are now 3 test sets to cover random ranges. Also added ROUND
mode to data generator to force integer exponent values.
LOG, EXP, RSQRT, REDUCE_SUM & FULLY_CONNECTED - have had their ranges
reduced for each test.
Fix generate library configuration defaults and checks.
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Change-Id: Ie5d3bd78f690cc787a2ca4eb9b4bd6808bd9238c
Diffstat (limited to 'verif/conformance/test_select.py')
-rw-r--r-- | verif/conformance/test_select.py | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/verif/conformance/test_select.py b/verif/conformance/test_select.py index faefc85..cebdf62 100644 --- a/verif/conformance/test_select.py +++ b/verif/conformance/test_select.py @@ -125,8 +125,6 @@ class Operator: # Working set of param_names - updated for negative tests wks_param_names = None - COMPLIANCE_SETS = ("_s0", "_s1", "_s2", "_s3", "_s4", "_s5") - def __init__( self, test_dir: Path, @@ -260,13 +258,13 @@ class Operator: if (not negative and "ERRORIF" not in str(path)) or ( negative and "ERRORIF" in str(path) ): - # Check for compliance test set paths - suffix = path.name[-3:] - if suffix in Operator.COMPLIANCE_SETS: - if suffix != Operator.COMPLIANCE_SETS[0]: - # Only return one of the test sets - continue - yield path.with_name(path.name[:-3]) + # Check for test set paths + match = re.match(r"(.*)_s([0-9]+)", path.name) + if match: + if match.group(2) == "0": + # Only return the truncated test name + # of the first test of a set + yield path.with_name(match.group(1)) else: yield path @@ -298,6 +296,23 @@ class Operator: params[param] = sorted(list(params[param])) return params + @staticmethod + def _get_test_set_paths(path): + """Expand a path to find all the test sets.""" + s = 0 + paths = [] + # Have a bound for the maximum test sets + while s < 100: + set_path = path.with_name(f"{path.name}_s{s}") + if set_path.exists(): + paths.append(set_path) + else: + if s == 0: + logger.error(f"Could not find test set 0 - {str(set_path)}") + break + s += 1 + return paths + def select_tests(self): # noqa: C901 (function too complex) """Generate the paths to the selected tests for this operator.""" if not self.test_paths: @@ -356,9 +371,9 @@ class Operator: if path.exists(): yield path else: - # Compliance test series - expand to all sets - for s in Operator.COMPLIANCE_SETS: - yield path.with_name(f"{path.name}{s}") + # Must be a test set - expand to all test sets + for p in Operator._get_test_set_paths(path): + yield p # search for tests that match any unused parameter values for n, path in enumerate(sorted(list(unused_paths))): @@ -377,9 +392,9 @@ class Operator: if path.exists(): yield path else: - # Compliance test series - expand to all sets - for s in Operator.COMPLIANCE_SETS: - yield path.with_name(f"{path.name}{s}") + # Must be a test set - expand to all test sets + for p in Operator._get_test_set_paths(path): + yield p break if not self.ignore_missing: |