diff options
author | Usama Arif <usama.arif@arm.com> | 2019-05-20 13:44:34 +0100 |
---|---|---|
committer | Usama Arif <usama.arif@arm.com> | 2019-05-22 15:13:21 +0000 |
commit | 28f0dd99fba11ed9b7165eca17d801bdfb421576 (patch) | |
tree | cb8bb464cdcea9946179ccf8add3158e50eefa48 /tests/validation/reference/ReductionOperation.cpp | |
parent | a4a08ad5e33867f9938a3fbaf9b6dcc56ad8f7b5 (diff) | |
download | ComputeLibrary-28f0dd99fba11ed9b7165eca17d801bdfb421576.tar.gz |
COMPMID-2279: Implement REDUCE_MAX operator for NEON
Change-Id: Iccd25b8aab1dd871c0d86ec3816b1cbf48370066
Signed-off-by: Usama Arif <usama.arif@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1193
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Diffstat (limited to 'tests/validation/reference/ReductionOperation.cpp')
-rw-r--r-- | tests/validation/reference/ReductionOperation.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
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; |