| 237 | } |
| 238 | |
| 239 | void 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 | |
| 278 | void ClGemm::configure_reshaped(const CLCompileContext &compile_context, |
| 279 | ITensorInfo *a, |
nothing calls this directly
no test coverage detected