3 #include "smaug/operators/smv/kernels/activation_functions_simd.h"
14 float16* host_results,
22 activation_fun_vec(inputs, results, inputs_size,
function, params);
32 float16* host_results,
40 inputs, host_inputs, input_num * (input_size + input_pad), 0, 0);
42 VEC_ARRAY_2D(
v8fp_t, _inputs, inputs, input_size + input_pad);
43 VEC_ARRAY_2D(
v8fp_t, _results, results, input_size + input_pad);
47 for (
int i = 0; i < input_num; i++) {
50 for (
int j = 0; j < input_vec_size; j++) {
53 _results[i][j][k] = exp(_inputs[i][j][k]);
59 for (
int j = 0; j < input_vec_size; j++) {
62 normaliz += _results[i][j][k];
67 normaliz = 1.0 / (normaliz + 1e-6);
70 for (
int j = 0; j < input_vec_size; j++) {
73 _results[i][j][k] *= normaliz;
79 results, host_results, input_num * (input_size + input_pad), 0, 0);