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

Method add_array_argument

src/core/CL/ICLKernel.h:539–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537 */
538template <typename T, unsigned int dimension_size>
539void ICLKernel::add_array_argument(
540 unsigned &idx, const ICLArray<T> *array, const Strides &strides, unsigned int num_dimensions, const Window &window)
541{
542 ARM_COMPUTE_ERROR_ON(array == nullptr);
543
544 // Calculate offset to the start of the window
545 unsigned int offset_first_element = 0;
546
547 for (unsigned int n = 0; n < num_dimensions; ++n)
548 {
549 offset_first_element += window[n].start() * strides[n];
550 }
551
552 unsigned int idx_start = idx;
553 _kernel.setArg(idx++, array->cl_buffer());
554
555 for (unsigned int dimension = 0; dimension < dimension_size; dimension++)
556 {
557 _kernel.setArg<cl_uint>(idx++, strides[dimension]);
558 _kernel.setArg<cl_uint>(idx++, strides[dimension] * window[dimension].step());
559 }
560
561 _kernel.setArg<cl_uint>(idx++, offset_first_element);
562
563 ARM_COMPUTE_ERROR_ON_MSG_VAR(idx_start + num_arguments_per_array<dimension_size>() != idx,
564 "add_%dD_array_argument() is supposed to add exactly %d arguments to the kernel",
565 dimension_size, num_arguments_per_array<dimension_size>());
566 ARM_COMPUTE_UNUSED(idx_start);
567}
568} // namespace arm_compute
569#endif /*ARM_COMPUTE_ICLKERNEL_H */

Callers

nothing calls this directly

Calls 3

setArgMethod · 0.80
stepMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected