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

Method run_op

src/gpu/cl/kernels/ClMatMulNativeMMULKernel.cpp:208–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208void ClMatMulNativeMMULKernel::run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue)
209{
210 ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this);
211 ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(ICLKernel::window(), window);
212
213 const ICLTensor *lhs =
214 utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_0));
215 const ICLTensor *rhs =
216 utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_1));
217 const ICLTensor *bias = utils::cast::polymorphic_downcast<const ICLTensor *>(
218 tensors.get_const_tensor(TensorType::ACL_SRC_2)); // nullptr if bias is not present
219 ICLTensor *dst = utils::cast::polymorphic_downcast<ICLTensor *>(tensors.get_tensor(TensorType::ACL_DST));
220 ARM_COMPUTE_ERROR_ON_NULLPTR(lhs, rhs, dst);
221 ARM_COMPUTE_LOG_PARAMS(lhs, rhs, bias, dst);
222 unsigned int idx = 0;
223
224 add_3d_tensor_nhw_argument(idx, lhs);
225 add_3d_tensor_nhw_argument(idx, rhs);
226 if (bias != nullptr)
227 {
228 add_3d_tensor_nhw_argument(idx, bias);
229 }
230 add_3d_tensor_nhw_argument(idx, dst);
231
232 // Pass m and n at runtime as signed ints, to ensure results of any subtractions they could be operand in, would still be signed.
233 _kernel.setArg<cl_int>(idx++, _m);
234 _kernel.setArg<cl_int>(idx++, _n);
235 _kernel.setArg<cl_int>(idx++, _k);
236
237 // LWS_x should be multiple of 16 at least. (32, 2) has been chosen to have more work-items on a single core
238 // LWS also enforces the order of execution of the work items which improves cache utilization
239 enqueue(queue, *this, window, cl::NDRange(32, 2), false);
240}
241
242} // namespace kernels
243} // namespace opencl

Callers

nothing calls this directly

Calls 3

get_const_tensorMethod · 0.80
NDRangeClass · 0.50
get_tensorMethod · 0.45

Tested by

no test coverage detected