diff options
author | Jerry Ge <jerry.ge@arm.com> | 2023-04-11 00:05:02 +0000 |
---|---|---|
committer | Jerry Ge <jerry.ge@arm.com> | 2023-04-20 22:53:37 +0000 |
commit | a793f4645d2c04543572de4d0bc84bf0a3689604 (patch) | |
tree | cfa8ff162c9315f079682c0913110ad25eb22cad /reference_model/src/ops/ewise_binary.cc | |
parent | 714aa6039a7e3585bf81ac90ce301767c08295af (diff) | |
download | reference_model-a793f4645d2c04543572de4d0bc84bf0a3689604.tar.gz |
Add level checking to TOSA Ref model
Signed-off-by: Jerry Ge <jerry.ge@arm.com>
Change-Id: I5689d7c6b902a319a68fa4628b59e0bcc23aeca4
Diffstat (limited to 'reference_model/src/ops/ewise_binary.cc')
-rw-r--r-- | reference_model/src/ops/ewise_binary.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/reference_model/src/ops/ewise_binary.cc b/reference_model/src/ops/ewise_binary.cc index 16386af..6aa0c0f 100644 --- a/reference_model/src/ops/ewise_binary.cc +++ b/reference_model/src/ops/ewise_binary.cc @@ -44,6 +44,10 @@ BinaryNodeBase<Rank, InDtype, OutDtype>::~BinaryNodeBase() template <int Rank, DType InDtype, DType OutDtype> int BinaryNodeBase<Rank, InDtype, OutDtype>::checkTensorAttributes() { + // Check Tosa Level + auto tosa_level = g_func_config.tosa_level; + LEVEL_CHECK(Rank <= tosa_level.MAX_RANK, "Rank should be smaller than or equal to MAX_RANK"); + if (validateRequiredOperands()) return 1; @@ -540,6 +544,10 @@ OpTable<Rank, InDtype>::~OpTable() template <int Rank, DType InDtype> int OpTable<Rank, InDtype>::checkTensorAttributes() { + // Check Tosa Level + auto tosa_level = g_func_config.tosa_level; + LEVEL_CHECK(Rank <= tosa_level.MAX_RANK, "Rank should be smaller than or equal to MAX_RANK"); + if (validateRequiredOperands()) return 1; |