aboutsummaryrefslogtreecommitdiff
path: root/verif
diff options
context:
space:
mode:
authorJeremy Johnson <jeremy.johnson@arm.com>2021-07-08 11:58:02 +0100
committerEric Kunze <eric.kunze@arm.com>2021-07-13 16:38:29 +0000
commit97eb75f204b21268b7a5d2e375bd025c8efb4043 (patch)
tree0de6fa5e3d90670487e42a7ac5721439191b1bae /verif
parent5fc4e683237274216d66dbd15727932657ebc6c4 (diff)
downloadreference_model-97eb75f204b21268b7a5d2e375bd025c8efb4043.tar.gz
Allow selection of higher rank tests using --target-rank
* The default rank range has been increased from 1-4 to 1-6. * Higher ranks often make tests too large so a default_test_rank_range has been included which makes the test generator produce only tests with ranks 1-4. * The user can now specify target-rank up to rank 6 which is allowed for all operators with the default rank range. * The maximum rank allowed (6) stored in TOSA_TENSOR_MAX_RANK variable. * User specified target shapes up to maximum rank are accepted without need for setting target-rank filter. Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: Ie4ca408d329cb1000ce9d3592b2c7d62bf311b3b
Diffstat (limited to 'verif')
-rw-r--r--verif/tosa_test_gen.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/verif/tosa_test_gen.py b/verif/tosa_test_gen.py
index df9a649..b3731ce 100644
--- a/verif/tosa_test_gen.py
+++ b/verif/tosa_test_gen.py
@@ -872,6 +872,9 @@ class TosaArgGen:
class TosaTestGen:
+ # Maximum rank of tensor supported by test generator.
+ TOSA_TENSOR_MAX_RANK = 6
+
def __init__(self, args):
self.args = args
self.basePath = args.output_dir
@@ -1617,6 +1620,9 @@ class TosaTestGen:
# Generate the lists of arguments
rmin, rmax = op["rank"]
+ # Create a default testing rank range, 1-4 inclusive to keep test sizes reasonably small.
+ default_test_rank_range = range(1, 5)
+
# Test list consists of a tuple of:
# (opName, testNameStr, dtype, shapeList, argumentsList)
testList = []
@@ -1629,6 +1635,8 @@ class TosaTestGen:
# Filter out the rank?
if rankFilter is not None and r not in rankFilter:
continue
+ if rankFilter is None and shapeFilter[0] is None and r not in default_test_rank_range:
+ continue
for t in op["types"]:
@@ -1954,7 +1962,7 @@ class TosaTestGen:
DType.FLOAT,
]
- DEFAULT_RANK_RANGE = (1, 4)
+ DEFAULT_RANK_RANGE = (1, TOSA_TENSOR_MAX_RANK)
TOSA_OP_LIST = {
# Tensor operators