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

Method run_op

src/gpu/cl/kernels/ClWinogradOutputTransformKernel.cpp:317–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317void ClWinogradOutputTransformKernel::run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue)
318{
319 ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this);
320 ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(IClKernel::window(), window);
321
322 auto src = utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_0));
323 auto bias = utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_1));
324 auto dst = utils::cast::polymorphic_downcast<ICLTensor *>(tensors.get_tensor(TensorType::ACL_DST));
325
326 // Collapse window
327 Window window_collapsed = window.collapse_if_possible(IClKernel::window(), Window::DimZ);
328
329 // Get initial windows
330 Window slice = window_collapsed.first_slice_window_4D();
331 slice.set(Window::DimZ, Window::Dimension(0, 1, 1));
332
333 // Setup output slice
334 Window slice_out(slice);
335 slice_out.set(Window::DimX, Window::Dimension(0, 0, 0));
336 slice_out.set(Window::DimY, Window::Dimension(0, 0, 0));
337
338 if (bias != nullptr)
339 {
340 unsigned int idx1 = 2 * num_arguments_per_4D_tensor();
341 Window slice_biases;
342 slice_biases.use_tensor_dimensions(bias->info()->tensor_shape());
343 add_1D_tensor_argument(idx1, bias, slice_biases);
344 }
345
346 if (_is_nhwc)
347 {
348 unsigned int idx2 = 2 * num_arguments_per_4D_tensor() + ((bias != nullptr) ? num_arguments_per_1D_tensor() : 0);
349 _kernel.setArg(idx2++, static_cast<int>(dst->info()->total_size() - dst->info()->strides_in_bytes().y()));
350 _kernel.setArg<cl_int>(idx2++, _src_height);
351 _kernel.setArg<cl_int>(idx2++, _dst_width);
352 _kernel.setArg<cl_int>(idx2++, _dst_height);
353 }
354
355 do
356 {
357 unsigned int idx = 0;
358 add_4D_tensor_argument(idx, src, slice);
359 add_4D_tensor_argument(idx, dst, slice_out);
360 enqueue(queue, *this, slice, lws_hint());
361 } while (window.slide_window_slice_3D(slice) && window.slide_window_slice_3D(slice_out));
362}
363} // namespace kernels
364} // namespace opencl
365} // namespace arm_compute

Callers

nothing calls this directly

Calls 11

get_const_tensorMethod · 0.80
collapse_if_possibleMethod · 0.80
first_slice_window_4DMethod · 0.80
setArgMethod · 0.80
slide_window_slice_3DMethod · 0.80
DimensionClass · 0.50
get_tensorMethod · 0.45
setMethod · 0.45
infoMethod · 0.45
total_sizeMethod · 0.45
yMethod · 0.45

Tested by

no test coverage detected