18#ifndef __NNFW_CKER_TENSOR_UTILS_H__
19#define __NNFW_CKER_TENSOR_UTILS_H__
34inline void CwiseClipping(
float *vector,
const int v_size,
const float clipping_value)
53 int v_size, T *__restrict__ result)
55 for (
int v = 0; v < v_size; v++)
57 *result++ = *vector1++ * *vector2++;
65 const T *__restrict__ vector2,
int v_size,
66 T *__restrict__ result)
68 for (
int v = 0; v < v_size; v++)
70 *result++ += *vector1++ * *vector2++;
77 int n_batch, T *result)
79 for (
int b = 0; b < n_batch; b++)
84 batch_vector += v_size;
93 const T *batch_vector,
int n_batch, T *result)
95 for (
int b = 0; b < n_batch; b++)
100 batch_vector += v_size;
115inline void Sub1Vector(
const float *vector,
int v_size,
float *result)
121 float *min,
float *max,
float *scaling_factor)
128 const int m_cols,
const int8_t *vector,
129 const float *scaling_factors,
int n_batch,
130 float *result,
int result_stride)
133 scaling_factors, n_batch, result, result_stride);
137 const float *vector,
int n_batch,
float *result,
141 result, result_stride);
145 const int m_cols,
const int8_t *vectors,
146 const float *scaling_factors,
int n_batch,
147 int32_t *scratch,
float *result,
int result_stride,
148 ruy::Context *ruy_context)
151 scaling_factors, n_batch, scratch, result, result_stride, ruy_context);
#define NEON_OR_PORTABLE(funcname,...)
void ZeroVector(float *vector, int v_size)
void VectorVectorCwiseProduct(const T *__restrict__ vector1, const T *__restrict__ vector2, int v_size, T *__restrict__ result)
void PortableMeanStddevNormalization(const float *input_vector, float *output_vector, int v_size, int n_batch)
void PortableZeroVector(float *vector, int v_size)
void MeanStddevNormalization(const float *input_vector, float *output_vector, int v_size, int n_batch)
void VectorBatchVectorCwiseProduct(const T *vector, int v_size, const T *batch_vector, int n_batch, T *result)
void Sub1Vector(const float *vector, int v_size, float *result)
void MatrixBatchVectorMultiplyAccumulate(const int8_t *matrix, const int m_rows, const int m_cols, const int8_t *vector, const float *scaling_factors, int n_batch, float *result, int result_stride)
void PortableApplyActivationToVector(const float *vector, int v_size, FusedActivationFunctionType activation, float *result)
void ApplyActivationToVector(const float *vector, int v_size, FusedActivationFunctionType activation, float *result)
void SymmetricQuantizeFloats(const float *values, const int size, int8_t *quantized_values, float *min, float *max, float *scaling_factor)
void VectorBatchVectorAssign(const float *vector, int v_size, int n_batch, float *batch_vector)
void PortableVectorBatchVectorAssign(const float *vector, int v_size, int n_batch, float *batch_vector)
void PortableVectorBatchVectorAdd(const float *vector, int v_size, int n_batch, float *batch_vector)
void CwiseClipping(float *vector, const int v_size, const float clipping_value)
void VectorVectorCwiseProductAccumulate(const T *__restrict__ vector1, const T *__restrict__ vector2, int v_size, T *__restrict__ result)
void VectorBatchVectorAdd(const float *vector, int v_size, int n_batch, float *batch_vector)
FusedActivationFunctionType
bool IsZeroVector(const float *vector, int v_size)
void VectorBatchVectorCwiseProductAccumulate(const T *vector, int v_size, const T *batch_vector, int n_batch, T *result)