diff options
Diffstat (limited to 'tests/validation/reference')
-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; |