#ifndef RUY_RUY_KERNEL_COMMON_H_
#define RUY_RUY_KERNEL_COMMON_H_
#include <algorithm>
#include <cstdint>
#include <type_traits>
#include "ruy/apply_multiplier.h"
#include "ruy/check_macros.h"
#include "ruy/mat.h"
#include "ruy/matrix.h"
#include "ruy/mul_params.h"
#include "ruy/opt_set.h"
#include "ruy/path.h"
#include "ruy/platform.h"
#include "ruy/profiler/instrumentation.h"
#include "ruy/side_pair.h"
#include "ruy/size_util.h"
#include "ruy/tune.h"
namespace ruy {
template <Path ThePath, typename LhsScalar, typename RhsScalar,
typename AccumScalar, typename DstScalar>
struct Kernel;
#define RUY_INHERIT_KERNEL(PARENT, CHILD) …
#if ((RUY_PLATFORM_NEON_64 || RUY_PLATFORM_NEON_32) && RUY_OPT(ASM)) || \
RUY_PLATFORM_X86
#define RUY_ASM_FLAG_HAS_BIAS …
#define RUY_ASM_FLAG_HAS_LHS_SUMS …
#define RUY_ASM_FLAG_HAS_RHS_SUMS …
#define RUY_ASM_FLAG_HAS_PERCHANNEL …
#define RUY_ASM_FLAG_NEEDS_LEFT_SHIFT …
#define RUY_ASM_FLAG_CHANNEL_DIMENSION_IS_COL …
#define RUY_ASM_TYPE_ID_UINT8 …
#define RUY_ASM_TYPE_ID_INT8 …
#define RUY_ASM_TYPE_ID_INT16 …
#define RUY_ASM_TYPE_ID_INT32 …
template <typename DstScalar>
struct DstTypeId { … };
template <>
struct DstTypeId<std::uint8_t> { … };
template <>
struct DstTypeId<std::int8_t> { … };
template <>
struct DstTypeId<std::int16_t> { … };
template <>
struct DstTypeId<std::int32_t> { … };
template <int LhsCols, int RhsCols>
struct KernelParams8bit { … };
template <typename RhsScalar, typename DstScalar, int LhsCols, int RhsCols>
void MakeKernelParams8bit(const PMat<std::int8_t>& lhs,
const PMat<RhsScalar>& rhs,
const MulParams<std::int32_t, DstScalar>& mul_params,
int start_row, int start_col, int end_row,
int end_col, Mat<DstScalar>* dst,
KernelParams8bit<LhsCols, RhsCols>* params) { … }
template <int LhsCols, int RhsCols>
struct KernelParamsFloat { … };
template <int LhsCols, int RhsCols>
inline void MakeKernelParamsFloat(const PMat<float>& lhs,
const PMat<float>& rhs,
const MulParams<float, float>& mul_params,
int start_row, int start_col, int end_row,
int end_col, Mat<float>* dst,
KernelParamsFloat<LhsCols, RhsCols>* params) { … }
#else
template <int LhsCols, int RhsCols>
struct KernelParams8bit {};
template <int LhsCols, int RhsCols>
struct KernelParamsFloat {};
#endif
}
#endif