MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / configure_native

Method configure_native

src/gpu/cl/operators/ClGemm.cpp:239–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239void ClGemm::configure_native(const CLCompileContext &compile_context,
240 ITensorInfo *a,
241 ITensorInfo *b,
242 ITensorInfo *c,
243 ITensorInfo *output,
244 float alpha,
245 float beta,
246 const GEMMInfo &gemm_info)
247{
248 DataType data_type = a->data_type();
249 bool reinterpret_input_as_3d = gemm_info.reinterpret_input_as_3d();
250 const unsigned int m = reinterpret_input_as_3d ? (a->dimension(1) * a->dimension(2)) : a->dimension(1);
251 const unsigned int n = b->dimension(0);
252 const unsigned int k = a->dimension(0);
253 const unsigned int batch_size = reinterpret_input_as_3d ? a->dimension(3) : a->dimension(2);
254 const int depth_output_gemm3d = gemm_info.depth_output_gemm3d();
255 const GPUTarget gpu_target = CLScheduler::get().target();
256 bool broadcast_bias = gemm_info.broadcast_bias();
257
258 GEMMKernelInfo kernel_info;
259 kernel_info.m = m;
260 kernel_info.n = n;
261 kernel_info.k = k;
262 kernel_info.depth_output_gemm3d = depth_output_gemm3d;
263 kernel_info.reinterpret_input_as_3d = reinterpret_input_as_3d;
264 kernel_info.broadcast_bias = broadcast_bias;
265 kernel_info.activation_info = gemm_info.activation_info();
266
267 // Set the target for the kernels
268 _mm_native_kernel->set_target(gpu_target);
269
270 auto config = auto_heuristics::select_mlgo_gemm_config_reshaped_only_rhs(
271 auto_heuristics::CommonQuery{gpu_target, data_type, m, n, k, batch_size});
272
273 // Configure and tune matrix multiply kernel
274 _mm_native_kernel->configure(compile_context, a, b, c, output, alpha, beta, config.lhs_info, config.rhs_info,
275 kernel_info);
276}
277
278void ClGemm::configure_reshaped(const CLCompileContext &compile_context,
279 ITensorInfo *a,

Callers

nothing calls this directly

Calls 10

data_typeMethod · 0.45
dimensionMethod · 0.45
depth_output_gemm3dMethod · 0.45
targetMethod · 0.45
broadcast_biasMethod · 0.45
activation_infoMethod · 0.45
set_targetMethod · 0.45
configureMethod · 0.45

Tested by

no test coverage detected