diff options
Diffstat (limited to 'reference_model/src/ops/comparison.cc')
-rw-r--r-- | reference_model/src/ops/comparison.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/reference_model/src/ops/comparison.cc b/reference_model/src/ops/comparison.cc index 5b78a4f..a5711eb 100644 --- a/reference_model/src/ops/comparison.cc +++ b/reference_model/src/ops/comparison.cc @@ -25,6 +25,10 @@ using namespace tosa; template <int Rank, DType Dtype> int OpEqual<Rank, Dtype>::register_fcn() { + // 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"); + switch (Dtype) { case DType_FP16: @@ -43,6 +47,10 @@ int OpEqual<Rank, Dtype>::register_fcn() template <int Rank, DType Dtype> int OpGreater<Rank, Dtype>::register_fcn() { + // 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"); + switch (Dtype) { case DType_FP16: @@ -61,6 +69,10 @@ int OpGreater<Rank, Dtype>::register_fcn() template <int Rank, DType Dtype> int OpGreaterEqual<Rank, Dtype>::register_fcn() { + // 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"); + switch (Dtype) { case DType_FP16: |