aboutsummaryrefslogtreecommitdiff
path: root/tests/validation
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validation')
-rw-r--r--tests/validation/NEON/ReductionOperation.cpp1
-rw-r--r--tests/validation/reference/ReductionOperation.cpp13
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/validation/NEON/ReductionOperation.cpp b/tests/validation/NEON/ReductionOperation.cpp
index 074689d678..5b697a5efa 100644
--- a/tests/validation/NEON/ReductionOperation.cpp
+++ b/tests/validation/NEON/ReductionOperation.cpp
@@ -53,6 +53,7 @@ const auto ReductionOperations = framework::dataset::make("ReductionOperation",
ReductionOperation::SUM,
ReductionOperation::PROD,
ReductionOperation::MIN,
+ ReductionOperation::MAX,
});
const auto QuantizationInfos = framework::dataset::make("QuantizationInfo",
diff --git a/tests/validation/reference/ReductionOperation.cpp b/tests/validation/reference/ReductionOperation.cpp
index 1f825f0e0f..571b991b92 100644
--- a/tests/validation/reference/ReductionOperation.cpp
+++ b/tests/validation/reference/ReductionOperation.cpp
@@ -51,6 +51,7 @@ OT reduce_operation(const T *ptr, int reduce_elements, ReductionOperation op, in
}
break;
case ReductionOperation::MIN:
+ case ReductionOperation::MAX:
{
res = *ptr;
}
@@ -88,6 +89,12 @@ OT reduce_operation(const T *ptr, int reduce_elements, ReductionOperation op, in
int_res = elem;
}
break;
+ case ReductionOperation::MAX:
+ if(static_cast<T>(int_res) < elem)
+ {
+ int_res = elem;
+ }
+ break;
case ReductionOperation::SUM_SQUARE:
int_res += elem * elem;
break;
@@ -133,6 +140,12 @@ OT reduce_operation(const T *ptr, int reduce_elements, ReductionOperation op, in
res = elem;
}
break;
+ case ReductionOperation::MAX:
+ if(res < elem)
+ {
+ res = elem;
+ }
+ break;
case ReductionOperation::SUM_SQUARE:
res += elem * elem;
break;