Marat Dukhan | ffbf96a | 2020-05-14 02:59:08 -0700 | [diff] [blame] | 1 | // Copyright 2020 Google LLC |
| 2 | // |
| 3 | // This source code is licensed under the BSD-style license found in the |
| 4 | // LICENSE file in the root directory of this source tree. |
| 5 | |
| 6 | #include <assert.h> |
| 7 | #include <math.h> |
| 8 | #include <stddef.h> |
| 9 | |
| 10 | #include <xnnpack/common.h> |
| 11 | #include <xnnpack/math-stubs.h> |
| 12 | |
| 13 | |
| 14 | void xnn_math_f32_roundu__scalar_ceil( |
| 15 | size_t n, |
| 16 | const float* input, |
| 17 | float* output) |
| 18 | { |
| 19 | assert(n % sizeof(float) == 0); |
| 20 | |
| 21 | for (; n != 0; n -= sizeof(float)) { |
| 22 | const float vx = *input++; |
| 23 | |
| 24 | const float vy = ceilf(vx); |
| 25 | |
| 26 | *output++ = vy; |
| 27 | } |
| 28 | } |