45 using ConfigurationFunctionExecutorPtr = std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> (
CLGEMMDefaultConfigNativeBifrost::*)(
unsigned int m,
unsigned int n,
unsigned int k,
49 static std::map<DataType, ConfigurationFunctionExecutorPtr> gemm_configs_G71 =
51 {
DataType::F32, &CLGEMMDefaultConfigNativeBifrost::configure_G71_f32 },
59 static std::map<DataType, ConfigurationFunctionExecutorPtr> gemm_configs_G76 =
61 {
DataType::F32, &CLGEMMDefaultConfigNativeBifrost::configure_G76_f32 },
69 static std::map<DataType, ConfigurationFunctionExecutorPtr> gemm_configs_default =
71 {
DataType::F32, &CLGEMMDefaultConfigNativeBifrost::configure_default_f32 },
73 {
DataType::QSYMM8, &CLGEMMDefaultConfigNativeBifrost::configure_default_u8 },
81 if(gemm_configs_G71.find(data_type) != gemm_configs_G71.end())
83 return (this->*gemm_configs_G71[data_type])(m, n, k,
b);
90 if(gemm_configs_G76.find(data_type) != gemm_configs_G76.end())
92 return (this->*gemm_configs_G76[data_type])(m, n, k,
b);
99 if(gemm_configs_default.find(data_type) != gemm_configs_default.end())
101 return (this->*gemm_configs_default[data_type])(m, n, k,
b);
110 std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> CLGEMMDefaultConfigNativeBifrost::configure_G71_f32(
unsigned int m,
unsigned int n,
unsigned int k,
unsigned int b)
119 return configure_lhs_rhs_info(m, n, 1, 2, 4, 1, 1,
false,
false,
false,
false);
121 else if(n >= 2048 && n < 8192)
123 return configure_lhs_rhs_info(m, n, 1, 4, 4, 1, 1,
false,
false,
false,
false);
127 return configure_lhs_rhs_info(m, n, 1, 8, 4, 1, 1,
false,
false,
false,
false);
132 return configure_lhs_rhs_info(m, n, 5, 4, 2, 1, 1,
false,
false,
false,
false);
136 std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> CLGEMMDefaultConfigNativeBifrost::configure_G71_u8(
unsigned int m,
unsigned int n,
unsigned int k,
unsigned int b)
147 return configure_lhs_rhs_info(m, n, 1, 2, 16, 1, 1,
false,
false,
false,
false);
149 else if(n >= 2048 && n < 16384)
151 return configure_lhs_rhs_info(m, n, 1, 4, 16, 1, 1,
false,
false,
false,
false);
155 return configure_lhs_rhs_info(m, n, 1, 8, 16, 1, 1,
false,
false,
false,
false);
162 return configure_lhs_rhs_info(m, n, 2, 2, 16, 1, 1,
false,
false,
false,
false);
166 return configure_lhs_rhs_info(m, n, 5, 2, 16, 1, 1,
false,
false,
false,
false);
176 return configure_lhs_rhs_info(m, n, 1, 4, 16, 1, 1,
false,
false,
false,
false);
180 return configure_lhs_rhs_info(m, n, 1, 8, 16, 1, 1,
false,
false,
false,
false);
185 return configure_lhs_rhs_info(m, n, 2, 8, 16, 1, 1,
false,
false,
false,
false);
190 std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> CLGEMMDefaultConfigNativeBifrost::configure_G76_f32(
unsigned int m,
unsigned int n,
unsigned int k,
unsigned int b)
199 return configure_lhs_rhs_info(m, n, 1, 4, 2, 1, 1,
false,
false,
false,
false);
205 return configure_lhs_rhs_info(m, n, 1, 2, 2, 1, 1,
false,
false,
false,
false);
207 else if(k >= 2048 && k < 16384)
209 return configure_lhs_rhs_info(m, n, 1, 2, 4, 1, 1,
false,
false,
false,
false);
213 return configure_lhs_rhs_info(m, n, 1, 2, 8, 1, 1,
false,
false,
false,
false);
219 return configure_lhs_rhs_info(m, n, 2, 8, 2, 1, 1,
false,
false,
false,
false);
223 std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> CLGEMMDefaultConfigNativeBifrost::configure_G76_u8(
unsigned int m,
unsigned int n,
unsigned int k,
unsigned int b)
232 return configure_lhs_rhs_info(m, n, 1, 2, 16, 1, 1,
false,
false,
false,
false);
234 else if(n >= 2048 && n < 16384)
236 return configure_lhs_rhs_info(m, n, 1, 4, 16, 1, 1,
false,
false,
false,
false);
240 return configure_lhs_rhs_info(m, n, 1, 8, 16, 1, 1,
false,
false,
false,
false);
247 return configure_lhs_rhs_info(m, n, 2, 2, 16, 1, 1,
false,
false,
false,
false);
251 return configure_lhs_rhs_info(m, n, 5, 2, 16, 1, 1,
false,
false,
false,
false);
256 std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> CLGEMMDefaultConfigNativeBifrost::configure_default_f32(
unsigned int m,
unsigned int n,
unsigned int k,
unsigned int b)
261 return configure_lhs_rhs_info(m, n, 5, 4, 4, 1, 1,
false,
false,
false,
false);
264 std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> CLGEMMDefaultConfigNativeBifrost::configure_default_u8(
unsigned int m,
unsigned int n,
unsigned int k,
unsigned int b)
269 return configure_lhs_rhs_info(m, n, 5, 2, 16, 1, 1,
false,
false,
false,
false);
Basic interface for the GEMM kernel configuration.
bool dot8_supported(const cl::Device &device)
Helper function to check whether the cl_arm_integer_dot_product_int8 extension is supported...
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
1 channel, 1 F32 per channel
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
std::pair< GEMMLHSMatrixInfo, GEMMRHSMatrixInfo > configure(unsigned int m, unsigned int n, unsigned int k, unsigned int b, DataType data_type) override
Given M, N, K and B, this method returns the GEMMLHSMatrixInfo and GEMMRHSMatrixInfo to be used...
Copyright (c) 2017-2021 Arm Limited.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
quantized, asymmetric fixed-point 8-bit number unsigned
quantized, symmetric fixed-point 8-bit number
quantized, symmetric per channel fixed-point 8-bit number
GPUTarget
Available GPU Targets.
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context...
CLGEMMDefaultConfigNativeBifrost(GPUTarget gpu)
Constructor.
std::pair< GEMMLHSMatrixInfo, GEMMRHSMatrixInfo > configure_lhs_rhs_info(unsigned int m, unsigned int n, unsigned int m0, unsigned int n0, unsigned int k0, unsigned int v0, unsigned int h0, bool lhs_interleave, bool rhs_interleave, bool lhs_transpose, bool rhs_transpose, bool export_to_cl_image)
Configure GEMMLHSMatrixInfo and GEMMRHSMatrixInfo.
quantized, asymmetric fixed-point 8-bit number signed
DataType
Available data types.