Compute Library
 23.11
CLPadLayerKernel Class Reference

Interface for the PadLayer function. More...

#include <CLPadLayerKernel.h>

Collaboration diagram for CLPadLayerKernel:
[legend]

Public Member Functions

 CLPadLayerKernel ()
 Default constructor. More...
 
 CLPadLayerKernel (const CLPadLayerKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CLPadLayerKerneloperator= (const CLPadLayerKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CLPadLayerKernel (CLPadLayerKernel &&)=default
 Allow instances of this class to be moved. More...
 
CLPadLayerKerneloperator= (CLPadLayerKernel &&)=default
 Allow instances of this class to be moved. More...
 
 ~CLPadLayerKernel ()=default
 Default destructor. More...
 
void configure (const ICLTensor *input, ICLTensor *output, const PaddingList &padding, PixelValue constant_value=PixelValue(), PaddingMode mode=PaddingMode::CONSTANT)
 Set the input and output tensor. More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output, const PaddingList &padding, PixelValue constant_value=PixelValue(), PaddingMode mode=PaddingMode::CONSTANT)
 Set the input and output tensor. More...
 
void run (const Window &window, cl::CommandQueue &queue) override
 Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue. More...
 
- Public Member Functions inherited from ICLKernel
 ICLKernel ()
 Constructor. More...
 
cl::Kernel & kernel ()
 Returns a reference to the OpenCL kernel of this object. More...
 
CLKernelType type () const
 Returns the CL kernel type. More...
 
template<typename T >
void add_1D_array_argument (unsigned int &idx, const ICLArray< T > *array, const Strides &strides, unsigned int num_dimensions, const Window &window)
 Add the passed 1D array's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_1D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 1D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_1D_tensor_argument_if (bool cond, unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 1D tensor's parameters to the object's kernel's arguments starting from the index idx if the condition is true. More...
 
void add_2D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_2D_tensor_argument_if (bool cond, unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx if the condition is true. More...
 
void add_3D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 3D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_4D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 4D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_5D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 5D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_3d_tensor_nhw_argument (unsigned int &idx, const ICLTensor *tensor)
 Add the passed NHW 3D tensor's parameters to the object's kernel's arguments by passing strides, dimensions and the offset to the first valid element in bytes. More...
 
void add_4d_tensor_nhwc_argument (unsigned int &idx, const ICLTensor *tensor)
 Add the passed NHWC 4D tensor's parameters to the object's kernel's arguments by passing strides, dimensions and the offset to the first valid element in bytes. More...
 
virtual void run_op (ITensorPack &tensors, const Window &window, cl::CommandQueue &queue)
 Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue. More...
 
template<typename T >
void add_argument (unsigned int &idx, T value)
 Add the passed parameters to the object's kernel's arguments starting from the index idx. More...
 
void set_lws_hint (const cl::NDRange &lws_hint)
 Set the Local-Workgroup-Size hint. More...
 
cl::NDRange lws_hint () const
 Return the Local-Workgroup-Size hint. More...
 
void set_wbsm_hint (const cl_int &wbsm_hint)
 Set the workgroup batch size modifier hint. More...
 
cl_int wbsm_hint () const
 Return the workgroup batch size modifier hint. More...
 
const std::string & config_id () const
 Get the configuration ID. More...
 
void set_target (GPUTarget target)
 Set the targeted GPU architecture. More...
 
void set_target (cl::Device &device)
 Set the targeted GPU architecture according to the CL device. More...
 
GPUTarget get_target () const
 Get the targeted GPU architecture. More...
 
size_t get_max_workgroup_size ()
 Get the maximum workgroup size for the device the CLKernelLibrary uses. More...
 
cl::NDRange get_cached_gws () const
 Get the cached gws used to enqueue this kernel. More...
 
void cache_gws (const cl::NDRange &gws)
 Cache the latest gws used to enqueue this kernel. More...
 
template<unsigned int dimension_size>
void add_tensor_argument (unsigned &idx, const ICLTensor *tensor, const Window &window)
 
template<typename T , unsigned int dimension_size>
void add_array_argument (unsigned &idx, const ICLArray< T > *array, const Strides &strides, unsigned int num_dimensions, const Window &window)
 Add the passed array's parameters to the object's kernel's arguments starting from the index idx. More...
 
- Public Member Functions inherited from IKernel
 IKernel ()
 Constructor. More...
 
virtual ~IKernel ()=default
 Destructor. More...
 
virtual bool is_parallelisable () const
 Indicates whether or not the kernel is parallelisable. More...
 
virtual BorderSize border_size () const
 The size of the border for that kernel. More...
 
const Windowwindow () const
 The maximum window the kernel can be executed on. More...
 
bool is_window_configured () const
 Function to check if the embedded window of this kernel has been configured. More...
 

Static Public Member Functions

static Status validate (const ITensorInfo *input, const ITensorInfo *output, const PaddingList &padding, PixelValue constant_value=PixelValue(), PaddingMode mode=PaddingMode::CONSTANT)
 Static function to check if given info will lead to a valid configuration of CLPadLayerKernel. More...
 
- Static Public Member Functions inherited from ICLKernel
constexpr static unsigned int num_arguments_per_3d_tensor_nhw ()
 Returns the number of arguments enqueued per NHW 3D Tensor object. More...
 
constexpr static unsigned int num_arguments_per_4d_tensor_nhwc ()
 Returns the number of arguments enqueued per NHWC 4D Tensor object. More...
 
constexpr static unsigned int num_arguments_per_1D_array ()
 Returns the number of arguments enqueued per 1D array object. More...
 
constexpr static unsigned int num_arguments_per_1D_tensor ()
 Returns the number of arguments enqueued per 1D tensor object. More...
 
constexpr static unsigned int num_arguments_per_2D_tensor ()
 Returns the number of arguments enqueued per 2D tensor object. More...
 
constexpr static unsigned int num_arguments_per_3D_tensor ()
 Returns the number of arguments enqueued per 3D tensor object. More...
 
constexpr static unsigned int num_arguments_per_4D_tensor ()
 Returns the number of arguments enqueued per 4D tensor object. More...
 
static cl::NDRange gws_from_window (const Window &window, bool use_dummy_work_items)
 Get the global work size given an execution window. More...
 

Detailed Description

Interface for the PadLayer function.

Definition at line 34 of file CLPadLayerKernel.h.

Constructor & Destructor Documentation

◆ CLPadLayerKernel() [1/3]

Default constructor.

Definition at line 73 of file CLPadLayerKernel.cpp.

73  : _input(nullptr), _output(nullptr), _4d_enabled(false)
74 {
76 }

References arm_compute::ELEMENTWISE.

◆ CLPadLayerKernel() [2/3]

CLPadLayerKernel ( const CLPadLayerKernel )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ CLPadLayerKernel() [3/3]

Allow instances of this class to be moved.

◆ ~CLPadLayerKernel()

~CLPadLayerKernel ( )
default

Default destructor.

Member Function Documentation

◆ configure() [1/2]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
ICLTensor output,
const PaddingList padding,
PixelValue  constant_value = PixelValue(),
PaddingMode  mode = PaddingMode::CONSTANT 
)

Set the input and output tensor.

Parameters
[in]compile_contextThe compile context to be used.
[in]inputSource tensor. Data types supported: All.
[out]outputOutput tensor. Data type supported: same as input
[in]paddingThe padding for each spatial dimension of the input tensor. The pair padding[i] specifies the front and the end padding in the i-th dimension.
[in]constant_value(Optional) Constant value to be used for the padding.
[in]mode(Optional) Controls whether the padding should be filled with constant_value using CONSTANT, or reflect the input, either including the border values (SYMMETRIC) or not (REFLECT).

Definition at line 84 of file CLPadLayerKernel.cpp.

90 {
92  auto_init_if_empty(*output->info(),
93  input->info()->clone()->set_tensor_shape(
94  misc::shape_calculator::compute_padded_shape(input->info()->tensor_shape(), padding)));
95  ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), output->info(), padding, constant_value, mode));
96 
97  auto padding_info = get_padding_info({input, output});
98 
99  _input = input;
100  _output = output;
101  _4d_enabled = (mode == PaddingMode::CONSTANT) && (padding.size() > 3);
102 
103  // Set build options
104  const DataType &data_type = input->info()->data_type();
105  const unsigned int input_width = input->info()->dimension(0);
106  const unsigned int input_height = input->info()->dimension(1);
107  const unsigned int input_depth = input->info()->dimension(2);
108  const unsigned int pad_x_before = padding.at(0).first;
109  const unsigned int pad_y_before = padding.size() > 1 ? padding.at(1).first : 0;
110  const unsigned int pad_z_before = padding.size() > 2 ? padding.at(2).first : 0;
111  const unsigned int vec_size = adjust_vec_size(
112  std::min(16U, 32U / static_cast<unsigned int>(element_size_from_data_type(input->info()->data_type()))),
113  input_width);
114  const unsigned int pad_right_start = input_width + pad_x_before;
115  const unsigned int pad_x_before_remainder = pad_x_before % vec_size;
116  const unsigned int vec_size_leftover_write =
117  vec_size - (ceil_to_multiple(output->info()->dimension(0), vec_size) - output->info()->dimension(0));
118 
119  CLBuildOptions build_opts;
120  build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(data_type));
121  build_opts.add_option("-DVEC_SIZE=" + support::cpp11::to_string(vec_size));
122  build_opts.add_option("-DPAD_X_BEFORE=" + support::cpp11::to_string(pad_x_before));
123  build_opts.add_option("-DSRC_WIDTH=" + support::cpp11::to_string(input_width));
124  build_opts.add_option("-DPAD_X_BEFORE_REMAINDER=" + support::cpp11::to_string(pad_x_before_remainder));
125  build_opts.add_option("-DVEC_SIZE_LEFTOVER_WRITE=" + support::cpp11::to_string(vec_size_leftover_write));
126  if (padding.size() > 1)
127  {
128  build_opts.add_option("-DPAD_Y_BEFORE=" + support::cpp11::to_string(pad_y_before));
129  build_opts.add_option("-DSRC_HEIGHT=" + support::cpp11::to_string(input_height));
130 
131  if (padding.size() > 2)
132  {
133  build_opts.add_option("-DPAD_Z_BEFORE=" + support::cpp11::to_string(pad_z_before));
134  build_opts.add_option("-DSRC_DEPTH=" + support::cpp11::to_string(input_depth));
135  }
136  }
137 
138  std::string kernel_name = "pad_layer_";
139  switch (mode)
140  {
142  {
143  kernel_name += "constant";
144 
145  const unsigned int vec_size_leftover_read =
146  vec_size - (ceil_to_multiple(pad_right_start, vec_size) - pad_right_start);
147 
148  build_opts.add_option("-DCONST_VAL=" + string_from_pixel_value(constant_value, data_type));
149  build_opts.add_option("-DVEC_SIZE_LEFTOVER_READ=" + support::cpp11::to_string(vec_size_leftover_read));
150 
151  if (pad_x_before >= vec_size)
152  {
153  build_opts.add_option("-DTHREADS_TO_SKIP_BEFORE=" + support::cpp11::to_string(pad_x_before / vec_size));
154  build_opts.add_option("-DTHREADS_TO_SKIP_AFTER=" +
155  support::cpp11::to_string(pad_right_start / vec_size));
156  }
157  if (_4d_enabled)
158  {
159  build_opts.add_option("-DPAD_W_BEFORE=" + support::cpp11::to_string(padding.at(3).first));
160  build_opts.add_option("-DSRC_BATCH=" + support::cpp11::to_string(input->info()->dimension(3)));
161  }
162 
163  break;
164  }
167  {
168  kernel_name += "symmetric_reflect";
169 
170  const auto is_reflect = static_cast<unsigned int>(mode == PaddingMode::REFLECT);
171 
172  const unsigned int pad_x_after_remainder = pad_right_start % vec_size;
173  const unsigned int after_pad_fact_x = (2 * input_width + pad_x_before) - is_reflect;
174  const unsigned int output_last_x = ceil_to_multiple(pad_right_start + padding.at(0).second, vec_size);
175 
176  build_opts.add_option("-DIS_REFLECT=" + support::cpp11::to_string(is_reflect));
177  build_opts.add_option("-DPAD_X_AFTER_REMAINDER=" + support::cpp11::to_string(pad_x_after_remainder));
178  build_opts.add_option("-DPAD_X_BEFORE_REMAINDER_REFL=" +
179  support::cpp11::to_string((pad_x_before_remainder + is_reflect) % vec_size));
180  build_opts.add_option("-DPAD_X_AFTER_REMAINDER_REFL=" +
181  support::cpp11::to_string((pad_x_after_remainder - is_reflect) % vec_size));
182  build_opts.add_option("-DAFTER_PAD_FACT_X=" + support::cpp11::to_string(after_pad_fact_x));
183  build_opts.add_option_if(after_pad_fact_x < output_last_x,
184  "-DAFTER_PAD_REM=" + support::cpp11::to_string(after_pad_fact_x % vec_size));
185 
186  break;
187  }
188  default:
189  ARM_COMPUTE_ERROR("Padding mode not supported.");
190  }
191 
192  // Create kernel
193  _kernel = create_kernel(compile_context, kernel_name, build_opts.options());
194 
195  // Configure window
196  Window win = calculate_max_window(*output->info(), Steps(vec_size));
197  ICLKernel::configure_internal(win);
198 
200 }

References CLBuildOptions::add_option(), arm_compute::adjust_vec_size(), ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::auto_init_if_empty(), arm_compute::calculate_max_window(), arm_compute::ceil_to_multiple(), arm_compute::misc::shape_calculator::compute_padded_shape(), arm_compute::CONSTANT, arm_compute::create_kernel(), arm_compute::test::validation::data_type, ITensorInfo::dimension(), arm_compute::element_size_from_data_type(), arm_compute::get_cl_type_from_data_type(), arm_compute::get_padding_info(), arm_compute::has_padding_changed(), ITensor::info(), arm_compute::test::validation::input, kernel_name, clang_tidy_rules::mode, arm_compute::REFLECT, arm_compute::string_from_pixel_value(), arm_compute::SYMMETRIC, arm_compute::support::cpp11::to_string(), arm_compute::utils::cast::U, and arm_compute::cpu::kernels::validate_arguments().

◆ configure() [2/2]

void configure ( const ICLTensor input,
ICLTensor output,
const PaddingList padding,
PixelValue  constant_value = PixelValue(),
PaddingMode  mode = PaddingMode::CONSTANT 
)

Set the input and output tensor.

Parameters
[in]inputSource tensor. Data types supported: All.
[out]outputOutput tensor. Data type supported: same as input
[in]paddingThe padding for each spatial dimension of the input tensor. The pair padding[i] specifies the front and the end padding in the i-th dimension.
[in]constant_value(Optional) Constant value to be used for the padding.
[in]mode(Optional) Controls whether the padding should be filled with constant_value using CONSTANT, or reflect the input, either including the border values (SYMMETRIC) or not (REFLECT).

Definition at line 78 of file CLPadLayerKernel.cpp.

80 {
81  configure(CLKernelLibrary::get().get_compile_context(), input, output, padding, constant_value, mode);
82 }

References CLKernelLibrary::get(), arm_compute::test::validation::input, and clang_tidy_rules::mode.

◆ operator=() [1/2]

CLPadLayerKernel& operator= ( CLPadLayerKernel &&  )
default

Allow instances of this class to be moved.

◆ operator=() [2/2]

CLPadLayerKernel& operator= ( const CLPadLayerKernel )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ run()

void run ( const Window window,
cl::CommandQueue &  queue 
)
overridevirtual

Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue.

Note
The queue is not flushed by this method, and therefore the kernel will not have been executed by the time this method returns.
Parameters
[in]windowRegion on which to execute the kernel. (Must be a valid region of the window returned by window()).
[in,out]queueCommand queue on which to enqueue the kernel.

Reimplemented from ICLKernel.

Definition at line 212 of file CLPadLayerKernel.cpp.

213 {
216 
218  unsigned int batch = 0;
219  do
220  {
221  unsigned int idx = 0;
222  add_3D_tensor_argument(idx, _input, slice);
223  add_3D_tensor_argument(idx, _output, slice);
224  if (_4d_enabled)
225  {
226  add_argument<unsigned int>(idx, batch++);
227  }
228 
229  enqueue(queue, *this, slice, lws_hint());
231 }

References ICLKernel::add_3D_tensor_argument(), ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, arm_compute::enqueue(), Window::first_slice_window_3D(), ICLKernel::lws_hint(), arm_compute::test::validation::reference::slice(), Window::slide_window_slice_3D(), and IKernel::window().

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output,
const PaddingList padding,
PixelValue  constant_value = PixelValue(),
PaddingMode  mode = PaddingMode::CONSTANT 
)
static

Static function to check if given info will lead to a valid configuration of CLPadLayerKernel.

Parameters
[in]inputSource tensor info. Data types supported: All.
[in]outputOutput tensor info. Data type supported: same as input
[in]paddingThe padding for each spatial dimension of the input tensor. The pair padding[i] specifies the front and the end padding in the i-th dimension.
[in]constant_value(Optional) Constant value to be used for the padding.
[in]mode(Optional) Controls whether the padding should be filled with constant_value using CONSTANT, or reflect the input, either including the border values (SYMMETRIC) or not (REFLECT).

Definition at line 202 of file CLPadLayerKernel.cpp.

207 {
208  ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(input, output, padding, constant_value, mode));
209  return Status{};
210 }

References ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::test::validation::input, clang_tidy_rules::mode, and arm_compute::cpu::kernels::validate_arguments().

Referenced by CLPadLayer::validate(), and CLGenerateProposalsLayer::validate().


The documentation for this class was generated from the following files:
arm_compute::support::cpp11::to_string
std::string to_string(T &&value)
Convert integer and float values to string.
Definition: StringSupport.h:168
arm_compute::calculate_max_window
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
Definition: WindowHelpers.cpp:29
arm_compute::cpu::kernels::validate_arguments
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
Definition: CpuDirectConv2dKernel.cpp:57
ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
Definition: Validate.h:1079
arm_compute::string_from_pixel_value
std::string string_from_pixel_value(const PixelValue &value, const DataType data_type)
Convert a PixelValue to a string, represented through the specific data type.
Definition: Utils.cpp:165
ARM_COMPUTE_ERROR
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:354
arm_compute::element_size_from_data_type
size_t element_size_from_data_type(DataType dt)
The size in bytes of the data type.
Definition: DataTypeUtils.h:78
arm_compute::CLKernelLibrary::get
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
Definition: CLKernelLibrary.cpp:41
ARM_COMPUTE_RETURN_ON_ERROR
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:205
ARM_COMPUTE_ERROR_ON_NULLPTR
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:159
ARM_COMPUTE_ERROR_ON
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
ARM_COMPUTE_ERROR_THROW_ON
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Definition: Error.h:455
arm_compute::PaddingMode::REFLECT
@ REFLECT
arm_compute::auto_init_if_empty
bool auto_init_if_empty(ITensorInfo &info, const TensorShape &shape, int num_channels, DataType data_type, QuantizationInfo quantization_info=QuantizationInfo())
Auto initialize the tensor info (shape, number of channels and data type) if the current assignment i...
Definition: AutoConfiguration.h:43
arm_compute::create_kernel
cl::Kernel create_kernel(const CLCompileContext &ctx, const std::string &kernel_name, const std::set< std::string > &build_opts=std::set< std::string >())
Creates an opencl kernel using a compile context.
Definition: CLHelpers.cpp:409
ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
Definition: Validate.h:203
arm_compute::Window::slide_window_slice_3D
bool slide_window_slice_3D(Window &slice) const
Slide the passed 3D window slice.
Definition: Window.h:350
arm_compute::test::validation::data_type
data_type
Definition: Cast.cpp:222
arm_compute::ceil_to_multiple
auto ceil_to_multiple(S value, T divisor) -> decltype(((value+divisor - 1)/divisor) *divisor)
Computes the smallest number larger or equal to value that is a multiple of divisor.
Definition: Math.h:50
arm_compute::Window::first_slice_window_3D
Window first_slice_window_3D() const
First 3D slice of the window.
Definition: Window.h:306
arm_compute::misc::shape_calculator::compute_padded_shape
TensorShape compute_padded_shape(const TensorShape &input_shape, const PaddingList &padding)
Calculate the padded shape of a tensor.
Definition: ShapeCalculator.h:1366
arm_compute::IKernel::window
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
arm_compute::get_cl_type_from_data_type
std::string get_cl_type_from_data_type(const DataType &dt)
Translates a tensor data type to the appropriate OpenCL type.
Definition: CLHelpers.cpp:41
arm_compute::ICLKernel::add_3D_tensor_argument
void add_3D_tensor_argument(unsigned int &idx, const ICLTensor *tensor, const Window &window)
Add the passed 3D tensor's parameters to the object's kernel's arguments starting from the index idx.
Definition: ICLKernel.h:234
arm_compute::ELEMENTWISE
@ ELEMENTWISE
Elementwise CL kernel type.
Definition: CLTypes.h:83
arm_compute::CLPadLayerKernel::configure
void configure(const ICLTensor *input, ICLTensor *output, const PaddingList &padding, PixelValue constant_value=PixelValue(), PaddingMode mode=PaddingMode::CONSTANT)
Set the input and output tensor.
Definition: CLPadLayerKernel.cpp:78
arm_compute::PaddingMode::SYMMETRIC
@ SYMMETRIC
clang_tidy_rules.mode
mode
Definition: clang_tidy_rules.py:196
arm_compute::adjust_vec_size
unsigned int adjust_vec_size(unsigned int vec_size, size_t dim0)
Returns the adjusted vector size in case it is less than the input's first dimension,...
Definition: AdjustVecSize.h:38
arm_compute::has_padding_changed
bool has_padding_changed(const std::unordered_map< const ITensorInfo *, PaddingSize > &padding_map)
Check if the previously stored padding info has changed after configuring a kernel.
Definition: Utils.cpp:491
arm_compute::ICLKernel::lws_hint
cl::NDRange lws_hint() const
Return the Local-Workgroup-Size hint.
Definition: ICLKernel.h:383
arm_compute::PaddingMode::CONSTANT
@ CONSTANT
arm_compute::DataType
DataType
Available data types.
Definition: CoreTypes.h:83
arm_compute::get_padding_info
std::unordered_map< const ITensorInfo *, PaddingSize > get_padding_info(std::initializer_list< const ITensorInfo * > infos)
Stores padding information before configuring a kernel.
Definition: Utils.cpp:476
arm_compute::test::validation::reference::slice
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)
Definition: SliceOperations.cpp:38
arm_compute::test::validation::input
auto input
Definition: LSTMLayerQuantized.cpp:486
kernel_name
std::string kernel_name
Definition: ClIm2ColKernel.cpp:58
arm_compute::enqueue
void enqueue(cl::CommandQueue &queue, ICLKernel &kernel, const Window &window, const cl::NDRange &lws_hint=CLKernelLibrary::get().default_ndrange(), bool use_dummy_work_items=false)
Add the kernel to the command queue with the given window.
Definition: ICLKernel.cpp:33