| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
#include <assert.h> |
| 11 |
#include <math.h> |
| 12 |
|
| 13 |
#include <arm_fp16.h> |
| 14 |
|
| 15 |
#include "xnnpack/common.h" |
| 16 |
#include "xnnpack/intrinsics-polyfill.h" |
| 17 |
#include "xnnpack/vunary.h" |
| 18 |
|
| 19 |
|
| 20 |
void xnn_f16_vsqrt_ukernel__fp16arith_sqrt_u1( |
| 21 |
size_t batch, |
| 22 |
const xnn_float16* input, |
| 23 |
xnn_float16* output, |
| 24 |
const struct xnn_f16_default_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_OOB_READS |
| 25 |
{ |
| 26 |
assert(batch != 0); |
| 27 |
assert(batch % sizeof(float16_t) == 0); |
| 28 |
assert(input != NULL); |
| 29 |
assert(output != NULL); |
| 30 |
|
| 31 |
const float16_t* i = (const float16_t*) input; |
| 32 |
float16_t* o = (float16_t*) output; |
| 33 |
do { |
| 34 |
float16_t vacc = *i++; |
| 35 |
vacc = vsqrth_f16(vacc); |
| 36 |
*o++ = vacc; |
| 37 |
batch -= sizeof(float16_t); |
| 38 |
} while (batch != 0); |
| 39 |
} |