Compute Library
 23.11
CLBatchToSpaceLayerKernel Class Reference

Interface for the batch to space kernel. More...

#include <CLBatchToSpaceLayerKernel.h>

Collaboration diagram for CLBatchToSpaceLayerKernel:
[legend]

Public Member Functions

 CLBatchToSpaceLayerKernel ()
 Default constructor. More...
 
 CLBatchToSpaceLayerKernel (const CLBatchToSpaceLayerKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CLBatchToSpaceLayerKerneloperator= (const CLBatchToSpaceLayerKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CLBatchToSpaceLayerKernel (CLBatchToSpaceLayerKernel &&)=default
 Allow instances of this class to be moved. More...
 
CLBatchToSpaceLayerKerneloperator= (CLBatchToSpaceLayerKernel &&)=default
 Allow instances of this class to be moved. More...
 
 ~CLBatchToSpaceLayerKernel ()=default
 Default destructor. More...
 
void configure (const ICLTensor *input, const ICLTensor *block_shape, ICLTensor *output)
 Initialise the kernel's inputs and output. More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, const ICLTensor *block_shape, ICLTensor *output)
 Initialise the kernel's inputs and output. More...
 
void configure (const ICLTensor *input, const int32_t block_shape_x, const int32_t block_shape_y, ICLTensor *output, const CropInfo &crop_info)
 Initialise the kernel's inputs and output (Static block shape). More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, const int32_t block_shape_x, const int32_t block_shape_y, ICLTensor *output, const CropInfo &crop_info)
 Initialise the kernel's inputs and output (Static block shape). 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 *block_shape, const ITensorInfo *output)
 Static function to check if given info will lead to a valid configuration of CLBatchToSpaceLayerKernel. More...
 
static Status validate (const ITensorInfo *input, const int32_t block_shape_x, const int32_t block_shape_y, const ITensorInfo *output, const CropInfo &crop_info)
 Static function to check if given info will lead to a valid configuration of CLBatchToSpaceLayerKernel (Static block shape). 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 batch to space kernel.

Definition at line 36 of file CLBatchToSpaceLayerKernel.h.

Constructor & Destructor Documentation

◆ CLBatchToSpaceLayerKernel() [1/3]

Default constructor.

Definition at line 88 of file CLBatchToSpaceLayerKernel.cpp.

88  : _input(nullptr), _block_shape(nullptr), _output(nullptr)
89 {
91 }

References arm_compute::ELEMENTWISE.

◆ CLBatchToSpaceLayerKernel() [2/3]

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

◆ CLBatchToSpaceLayerKernel() [3/3]

Allow instances of this class to be moved.

◆ ~CLBatchToSpaceLayerKernel()

Default destructor.

Member Function Documentation

◆ configure() [1/4]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
const ICLTensor block_shape,
ICLTensor output 
)

Initialise the kernel's inputs and output.

Parameters
[in]compile_contextThe compile context to be used.
[in]inputTensor input. Supported tensor rank: 4. Data types supported: All.
[in]block_shape1-D tensor with shape [M]. Data types supported: S32
[out]outputTensor output. Data types supported: same as input
Deprecated:
This method for dynamic block shape is not fully mature and will be removed in 23.08 release

Definition at line 98 of file CLBatchToSpaceLayerKernel.cpp.

102 {
104 
105  auto padding_info = get_padding_info({input, block_shape, output});
106 
107  ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), block_shape->info(), output->info()));
108 
109  _input = input;
110  _block_shape = block_shape;
111  _output = output;
112 
113  // Create kernel
114  CLBuildOptions build_opts;
115  build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(output->info()->data_type()));
116  build_opts.add_option("-DBATCH_SIZE=" + support::cpp11::to_string(output->info()->dimension(3)));
117  _kernel = create_kernel(compile_context,
118  "batch_to_space_" + lower_string(string_from_data_layout(input->info()->data_layout())),
119  build_opts.options());
120 
121  // Configure kernel window
122  Window win = calculate_max_window(*output->info(), Steps());
123  ICLKernel::configure_internal(win);
124 
126 }

References CLBuildOptions::add_option(), ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::calculate_max_window(), arm_compute::create_kernel(), ITensorInfo::data_type(), ITensorInfo::dimension(), 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, arm_compute::lower_string(), CLBuildOptions::options(), arm_compute::string_from_data_layout(), arm_compute::support::cpp11::to_string(), and arm_compute::cpu::kernels::validate_arguments().

◆ configure() [2/4]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
const int32_t  block_shape_x,
const int32_t  block_shape_y,
ICLTensor output,
const CropInfo crop_info 
)

Initialise the kernel's inputs and output (Static block shape).

Parameters
[in]compile_contextThe compile context to be used.
[in]inputTensor input. Supported tensor rank: 4. Data types supported: All.
[in]block_shape_xBlock shape x value.
[in]block_shape_yBlock shape y value.
[out]outputTensor output. Data types supported: same as input
[in]crop_infoSpecifies how the output shape is cropped after batch to space is performed

Definition at line 137 of file CLBatchToSpaceLayerKernel.cpp.

143 {
145 
146  const TensorShape output_shape = compute_batch_to_space_shape(
147  input->info()->data_layout(), input->info()->tensor_shape(), block_shape_x, block_shape_y);
148  auto_init_if_empty(*output->info(), input->info()->clone()->set_tensor_shape(output_shape));
149 
151  validate_arguments_static(input->info(), block_shape_x, block_shape_y, output->info(), crop_info));
152 
153  _input = input;
154  _output = output;
155 
156  // Create kernel
157  CLBuildOptions build_opts;
158  build_opts.add_option("-DDATA_TYPE=" +
160  build_opts.add_option("-DBATCH_SIZE=" + support::cpp11::to_string(output->info()->dimension(3)));
161  build_opts.add_option("-DBLOCK_SHAPE_X=" + support::cpp11::to_string(block_shape_x));
162  build_opts.add_option("-DBLOCK_SHAPE_Y=" + support::cpp11::to_string(block_shape_y));
163  build_opts.add_option("-DCROP_LEFT=" + support::cpp11::to_string(crop_info.left));
164  build_opts.add_option("-DCROP_TOP=" + support::cpp11::to_string(crop_info.top));
165  _kernel = create_kernel(
166  compile_context, "batch_to_space_static_" + lower_string(string_from_data_layout(input->info()->data_layout())),
167  build_opts.options());
168 
169  // Configure kernel window
170  Window win = calculate_max_window(*output->info(), Steps());
171  ICLKernel::configure_internal(win);
172 }

References CLBuildOptions::add_option(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::auto_init_if_empty(), arm_compute::calculate_max_window(), arm_compute::misc::shape_calculator::compute_batch_to_space_shape(), arm_compute::create_kernel(), arm_compute::data_size_from_type(), ITensorInfo::dimension(), arm_compute::get_cl_unsigned_type_from_element_size(), ITensor::info(), arm_compute::test::validation::input, Padding2D::left, arm_compute::lower_string(), CLBuildOptions::options(), arm_compute::test::validation::output_shape, arm_compute::string_from_data_layout(), arm_compute::support::cpp11::to_string(), and Padding2D::top.

◆ configure() [3/4]

void configure ( const ICLTensor input,
const ICLTensor block_shape,
ICLTensor output 
)

Initialise the kernel's inputs and output.

Parameters
[in]inputTensor input. Supported tensor rank: 4. Data types supported: All.
[in]block_shape1-D tensor with shape [M]. Data types supported: S32
[out]outputTensor output. Data types supported: same as input
Deprecated:
This method for dynamic block shape is not fully mature and will be removed in 23.08 release

Definition at line 93 of file CLBatchToSpaceLayerKernel.cpp.

94 {
95  configure(CLKernelLibrary::get().get_compile_context(), input, block_shape, output);
96 }

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

Referenced by CLBatchToSpaceLayerKernel::configure().

◆ configure() [4/4]

void configure ( const ICLTensor input,
const int32_t  block_shape_x,
const int32_t  block_shape_y,
ICLTensor output,
const CropInfo crop_info 
)

Initialise the kernel's inputs and output (Static block shape).

Parameters
[in]inputTensor input. Supported tensor rank: 4. Data types supported: All.
[in]block_shape_xBlock shape x value.
[in]block_shape_yBlock shape y value.
[out]outputTensor output. Data types supported: same as input
[in]crop_infoSpecifies how the output shape is cropped after batch to space is performed

Definition at line 128 of file CLBatchToSpaceLayerKernel.cpp.

133 {
134  configure(CLKernelLibrary::get().get_compile_context(), input, block_shape_x, block_shape_y, output, crop_info);
135 }

References CLBatchToSpaceLayerKernel::configure(), CLKernelLibrary::get(), and arm_compute::test::validation::input.

◆ operator=() [1/2]

Allow instances of this class to be moved.

◆ operator=() [2/2]

CLBatchToSpaceLayerKernel& operator= ( const CLBatchToSpaceLayerKernel )
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 193 of file CLBatchToSpaceLayerKernel.cpp.

194 {
197 
198  Window slice_out = window.first_slice_window_3D();
199  Window slice_in = window.first_slice_window_4D();
200 
201  Window vector_slice = window.first_slice_window_1D();
202  vector_slice.set(Window::DimX, Window::Dimension(0, 0, 0));
203 
204  slice_in.set(Window::DimX, Window::Dimension(0, 0, 0));
205  slice_in.set(Window::DimY, Window::Dimension(0, 0, 0));
206  slice_in.set(Window::DimZ, Window::Dimension(0, 0, 0));
207  slice_in.set(3, Window::Dimension(0, 0, 0));
208 
209  int batch_id = 0;
210  do
211  {
212  unsigned int idx = 0;
213  add_4D_tensor_argument(idx, _input, slice_in);
214  add_argument(idx, batch_id);
215  if (_block_shape != nullptr)
216  {
217  add_1D_tensor_argument(idx, _block_shape, vector_slice);
218  }
219  add_3D_tensor_argument(idx, _output, slice_out);
220  enqueue(queue, *this, slice_out, lws_hint());
221 
222  ++batch_id;
223  } while (window.slide_window_slice_3D(slice_out));
224 }

References ICLKernel::add_1D_tensor_argument(), ICLKernel::add_3D_tensor_argument(), ICLKernel::add_4D_tensor_argument(), ICLKernel::add_argument(), ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, Window::DimX, Window::DimY, Window::DimZ, arm_compute::enqueue(), Window::first_slice_window_1D(), Window::first_slice_window_3D(), Window::first_slice_window_4D(), ICLKernel::lws_hint(), Window::set(), Window::slide_window_slice_3D(), and IKernel::window().

◆ validate() [1/2]

Status validate ( const ITensorInfo input,
const int32_t  block_shape_x,
const int32_t  block_shape_y,
const ITensorInfo output,
const CropInfo crop_info 
)
static

Static function to check if given info will lead to a valid configuration of CLBatchToSpaceLayerKernel (Static block shape).

Parameters
[in]inputTensor input. Supported tensor rank: 4. Data types supported: All.
[in]block_shape_xBlock shape x value.
[in]block_shape_yBlock shape y value.
[in]outputTensor output. Data types supported: same as input
[in]crop_infoSpecifies how the output shape is cropped after batch to space is performed
Returns
a status

Definition at line 182 of file CLBatchToSpaceLayerKernel.cpp.

187 {
189  ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments_static(input, block_shape_x, block_shape_y, output, crop_info));
190  return Status{};
191 }

References ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ON_ERROR, and arm_compute::test::validation::input.

◆ validate() [2/2]

Status validate ( const ITensorInfo input,
const ITensorInfo block_shape,
const ITensorInfo output 
)
static

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

Parameters
[in]inputTensor input. Supported tensor rank: 4. Data types supported: All.
[in]block_shape1-D tensor with shape [M]. Data types supported: S32
[in]outputTensor output. Data types supported: same as input
Returns
a status
Deprecated:
This method for dynamic block shape is not fully mature and will be removed in 23.08 release

Definition at line 175 of file CLBatchToSpaceLayerKernel.cpp.

176 {
177  ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input, block_shape, output);
179  return Status{};
180 }

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

Referenced by CLBatchToSpaceLayer::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::ICLKernel::add_1D_tensor_argument
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.
Definition: ICLKernel.h:186
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::test::validation::output_shape
TensorShape output_shape
Definition: LSTMLayerQuantized.cpp:469
arm_compute::lower_string
std::string lower_string(const std::string &val)
Lower a given string.
Definition: StringUtils.cpp:38
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::Window::DimX
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
Definition: Window.h:43
arm_compute::Window::first_slice_window_1D
Window first_slice_window_1D() const
First 1D slice of the window.
Definition: Window.h:290
arm_compute::CLKernelLibrary::get
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
Definition: CLKernelLibrary.cpp:41
arm_compute::CLBatchToSpaceLayerKernel::configure
void configure(const ICLTensor *input, const ICLTensor *block_shape, ICLTensor *output)
Initialise the kernel's inputs and output.
Definition: CLBatchToSpaceLayerKernel.cpp:93
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::data_size_from_type
size_t data_size_from_type(DataType data_type)
The size in bytes of the data type.
Definition: DataTypeUtils.h:38
ARM_COMPUTE_ERROR_THROW_ON
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Definition: Error.h:455
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::ICLKernel::add_argument
void add_argument(unsigned int &idx, T value)
Add the passed parameters to the object's kernel's arguments starting from the index idx.
Definition: ICLKernel.h:362
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::ICLKernel::add_4D_tensor_argument
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.
Definition: ICLKernel.h:244
arm_compute::Window::set
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
Definition: Window.inl:53
arm_compute::Window::DimY
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Definition: Window.h:45
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::IKernel::window
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
arm_compute::string_from_data_layout
const std::string & string_from_data_layout(DataLayout dl)
Convert a data layout identity into a string.
Definition: DataLayoutUtils.cpp:30
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::get_cl_unsigned_type_from_element_size
std::string get_cl_unsigned_type_from_element_size(size_t element_size)
Translates the element size to an unsigned integer data type.
Definition: CLHelpers.cpp:107
arm_compute::ELEMENTWISE
@ ELEMENTWISE
Elementwise CL kernel type.
Definition: CLTypes.h:83
arm_compute::misc::shape_calculator::compute_batch_to_space_shape
TensorShape compute_batch_to_space_shape(DataLayout data_layout, const TensorShape &input, int block_x, int block_y, const CropInfo &crop_info=CropInfo{})
Calculate the batch to space output shape of a tensor.
Definition: ShapeCalculator.h:1201
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::Window::DimZ
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Definition: Window.h:47
arm_compute::ICLKernel::lws_hint
cl::NDRange lws_hint() const
Return the Local-Workgroup-Size hint.
Definition: ICLKernel.h:383
ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161
arm_compute::Window::first_slice_window_4D
Window first_slice_window_4D() const
First 4D slice of the window.
Definition: Window.h:314
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::input
auto input
Definition: LSTMLayerQuantized.cpp:486
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