18#ifndef __NNFW_CKER_RUY_RUY_SUPPORT_H__
19#define __NNFW_CKER_RUY_RUY_SUPPORT_H__
22#include <ruy/matrix.h>
50template <
typename Scalar,
typename DataPo
inter>
52 ruy::Matrix<Scalar> *dst,
bool use_caching =
false)
56 ruy::MakeSimpleLayout(params.
rows, params.
cols, ruy_order, dst->mutable_layout());
59 dst->set_data(data_ptr);
68template <
typename DstScalar, QuantizationFlavor quantization_flavor>
70 ruy::MulParams<std::int32_t, DstScalar> *ruy_mul_params)
72 static_assert(
sizeof(DstScalar) <
sizeof(std::int32_t),
"");
83 ruy_mul_params->set_bias(params.
bias);
84 ruy_mul_params->set_clamp_min(params.
clamp_min);
85 ruy_mul_params->set_clamp_max(params.
clamp_max);
89template <QuantizationFlavor quantization_flavor>
91 ruy::MulParams<std::int32_t, std::int32_t> *ruy_mul_params)
93 ruy_mul_params->set_bias(params.
bias);
ruy::CachePolicy ToRuyCachePolicy(CachePolicy cache_policy)
void MakeRuyMulParams(const GemmParams< std::int32_t, DstScalar, quantization_flavor > ¶ms, ruy::MulParams< std::int32_t, DstScalar > *ruy_mul_params)
void MakeRuyMatrix(const MatrixParams< Scalar > ¶ms, DataPointer data_ptr, ruy::Matrix< Scalar > *dst, bool use_caching=false)
@ kIntegerWithPerRowMultiplier
@ kIntegerWithUniformMultiplier
AccumScalar multiplier_fixedpoint
const int * multiplier_exponent_perchannel
const AccumScalar * multiplier_fixedpoint_perchannel