Compute Library
 21.05
CLFillBorderKernel Class Reference

Interface for filling the border of a kernel. More...

#include <CLFillBorderKernel.h>

Collaboration diagram for CLFillBorderKernel:
[legend]

Public Member Functions

 CLFillBorderKernel ()
 Default constructor. More...
 
 CLFillBorderKernel (const CLFillBorderKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CLFillBorderKerneloperator= (const CLFillBorderKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CLFillBorderKernel (CLFillBorderKernel &&)=default
 Allow instances of this class to be moved. More...
 
CLFillBorderKerneloperator= (CLFillBorderKernel &&)=default
 Allow instances of this class to be moved. More...
 
 ~CLFillBorderKernel ()=default
 Default destructor. More...
 
void configure (const CLCompileContext &compile_context, ICLTensor *tensor, BorderSize border_size, BorderMode border_mode, const PixelValue &constant_border_value=PixelValue())
 Initialise the kernel's input, output and border mode. More...
 
void configure (ICLTensor *tensor, BorderSize border_size, BorderMode border_mode, const PixelValue &constant_border_value=PixelValue())
 Initialise the kernel's input, output and border mode. More...
 
void configure (const CLCompileContext &compile_context, ITensorInfo *tensor, BorderSize border_size, BorderMode border_mode, const PixelValue &constant_border_value=PixelValue())
 Initialise the kernel's input, output and border mode. More...
 
template<class T >
void set_constant_border (unsigned int idx, const PixelValue &constant_border_value)
 Function to set the constant value on fill border kernel depending on type. More...
 
void run_op (ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override
 Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue. 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...
 
bool is_parallelisable () const override
 Indicates whether or not the kernel is parallelisable. More...
 
- Public Member Functions inherited from ICLKernel
 ICLKernel ()
 Constructor. More...
 
cl::Kernel & kernel ()
 Returns a reference to the OpenCL kernel of this object. 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...
 
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...
 
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 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from ICLKernel
static constexpr unsigned int num_arguments_per_1D_array ()
 Returns the number of arguments enqueued per 1D array object. More...
 
static constexpr unsigned int num_arguments_per_1D_tensor ()
 Returns the number of arguments enqueued per 1D tensor object. More...
 
static constexpr unsigned int num_arguments_per_2D_tensor ()
 Returns the number of arguments enqueued per 2D tensor object. More...
 
static constexpr unsigned int num_arguments_per_3D_tensor ()
 Returns the number of arguments enqueued per 3D tensor object. More...
 
static constexpr 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)
 Get the global work size given an execution window. More...
 

Detailed Description

Interface for filling the border of a kernel.

Definition at line 36 of file CLFillBorderKernel.h.

Constructor & Destructor Documentation

◆ CLFillBorderKernel() [1/3]

Default constructor.

Definition at line 39 of file CLFillBorderKernel.cpp.

40  : ICLKernel(), _tensor(nullptr)
41 {
42 }
ICLKernel()
Constructor.
Definition: ICLKernel.h:93

◆ CLFillBorderKernel() [2/3]

CLFillBorderKernel ( const CLFillBorderKernel )
delete

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

◆ CLFillBorderKernel() [3/3]

Allow instances of this class to be moved.

◆ ~CLFillBorderKernel()

~CLFillBorderKernel ( )
default

Default destructor.

Member Function Documentation

◆ configure() [1/3]

void configure ( const CLCompileContext compile_context,
ICLTensor tensor,
BorderSize  border_size,
BorderMode  border_mode,
const PixelValue constant_border_value = PixelValue() 
)

Initialise the kernel's input, output and border mode.

Parameters
[in]compile_contextThe compile context to be used.
[in,out]tensorTensor to process Data types supported: U8/QASYMM8/S8/QASYMM8_SIGNED/U16/S16/U32/S32/F16/F32.
[in]border_sizeSize of the border to fill in elements.
[in]border_modeBorder mode to use for the convolution.
[in]constant_border_value(Optional) Constant value to use for borders if border_mode is set to CONSTANT.

Definition at line 62 of file CLFillBorderKernel.cpp.

63 {
64  _tensor = tensor;
65  configure(compile_context, tensor->info(), border_size, border_mode, constant_border_value);
66 }
void configure(const CLCompileContext &compile_context, ICLTensor *tensor, BorderSize border_size, BorderMode border_mode, const PixelValue &constant_border_value=PixelValue())
Initialise the kernel's input, output and border mode.
virtual BorderSize border_size() const
The size of the border for that kernel.
Definition: IKernel.cpp:46

References IKernel::border_size(), and ITensor::info().

Referenced by CLFillBorderKernel::configure(), CLSynthetizeFunctionInitOutputWithZeroAndWithZeroConstantBorder< K, bordersize >::configure(), and arm_compute::test::validation::DATA_TEST_CASE().

◆ configure() [2/3]

void configure ( ICLTensor tensor,
BorderSize  border_size,
BorderMode  border_mode,
const PixelValue constant_border_value = PixelValue() 
)

Initialise the kernel's input, output and border mode.

Parameters
[in,out]tensorTensor to process Data types supported: U8/QASYMM8/S8/QASYMM8_SIGNED/U16/S16/U32/S32/F16/F32.
[in]border_sizeSize of the border to fill in elements.
[in]border_modeBorder mode to use for the convolution.
[in]constant_border_value(Optional) Constant value to use for borders if border_mode is set to CONSTANT.

Definition at line 57 of file CLFillBorderKernel.cpp.

58 {
59  configure(CLKernelLibrary::get().get_compile_context(), tensor, border_size, border_mode, constant_border_value);
60 }
void configure(const CLCompileContext &compile_context, ICLTensor *tensor, BorderSize border_size, BorderMode border_mode, const PixelValue &constant_border_value=PixelValue())
Initialise the kernel's input, output and border mode.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
virtual BorderSize border_size() const
The size of the border for that kernel.
Definition: IKernel.cpp:46

References IKernel::border_size(), CLFillBorderKernel::configure(), and CLKernelLibrary::get().

◆ configure() [3/3]

void configure ( const CLCompileContext compile_context,
ITensorInfo tensor,
BorderSize  border_size,
BorderMode  border_mode,
const PixelValue constant_border_value = PixelValue() 
)

Initialise the kernel's input, output and border mode.

Parameters
[in]compile_contextThe compile context to be used.
[in,out]tensorTensor to process Data types supported: U8/QASYMM8/S8/QASYMM8_SIGNED/U16/S16/U32/S32/F16/F32.
[in]border_sizeSize of the border to fill in elements.
[in]border_modeBorder mode to use for the convolution.
[in]constant_border_value(Optional) Constant value to use for borders if border_mode is set to CONSTANT.

Definition at line 68 of file CLFillBorderKernel.cpp.

69 {
70  ARM_COMPUTE_ERROR_ON(tensor == nullptr);
71  ARM_COMPUTE_ERROR_ON(tensor->num_channels() != 1);
72  auto padding_info = get_padding_info({ tensor });
73 
74  border_size.limit(tensor->padding());
75 
76  // If there is no border: early exit
77  if(border_size.empty() || border_mode == BorderMode::UNDEFINED)
78  {
79  return;
80  }
81 
82  // Select appropriate kernel
83  std::string kernel_name = "fill_image_borders_" + lower_string(string_from_border_mode(border_mode));
84 
85  const DataType dt = tensor->data_type();
86 
87  // Define build options
88  CLBuildOptions build_opts;
89  build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(dt));
90  build_opts.add_option("-DBORDER_SIZE_TOP=" + support::cpp11::to_string(border_size.top));
91  build_opts.add_option("-DBORDER_SIZE_BOTTOM=" + support::cpp11::to_string(border_size.bottom));
92  build_opts.add_option("-DBORDER_SIZE_LEFT=" + support::cpp11::to_string(border_size.left));
93  build_opts.add_option("-DBORDER_SIZE_RIGHT=" + support::cpp11::to_string(border_size.right));
94 
95  // Create kernel
96  _kernel = create_kernel(compile_context, kernel_name, build_opts.options());
97 
98  // Create static kernel arguments
99  const unsigned int valid_width = tensor->valid_region().shape[0];
100  const unsigned int valid_height = tensor->valid_region().shape[1];
101  const cl_int2 valid_region_coords =
102  {
103  {
104  static_cast<cl_int>(tensor->valid_region().anchor[0]),
105  static_cast<cl_int>(tensor->valid_region().anchor[1]),
106  }
107  };
108  const unsigned int total_valid_width = border_size.left + valid_width + border_size.right;
109 
110  // Set static kernel arguments
111  unsigned int idx = num_arguments_per_3D_tensor(); //Skip the tensor parameters
112  ICLKernel::add_argument<cl_uint>(idx, valid_width);
113  ICLKernel::add_argument<cl_uint>(idx, valid_height);
114  ICLKernel::add_argument<cl_int2>(idx, valid_region_coords);
115  if(BorderMode::CONSTANT == border_mode)
116  {
117  switch(dt)
118  {
119  case DataType::U8:
120  case DataType::QASYMM8:
121  set_constant_border<uint8_t>(idx, constant_border_value);
122  break;
123  case DataType::S8:
125  set_constant_border<int8_t>(idx, constant_border_value);
126  break;
127  case DataType::U16:
128  set_constant_border<uint16_t>(idx, constant_border_value);
129  break;
130  case DataType::S16:
131  set_constant_border<int16_t>(idx, constant_border_value);
132  break;
133  case DataType::U32:
134  set_constant_border<uint32_t>(idx, constant_border_value);
135  break;
136  case DataType::S32:
137  set_constant_border<int32_t>(idx, constant_border_value);
138  break;
139  case DataType::F32:
140  static_assert(sizeof(float) == 4, "Float must be 32 bit");
141  set_constant_border<float>(idx, constant_border_value);
142  break;
143  case DataType::F16:
144  static_assert(sizeof(cl_half) == sizeof(half), "Half must be same size as cl_half");
145  static_assert(sizeof(cl_half) == 2, "Half must be 16 bit");
146  set_constant_border<half>(idx, constant_border_value);
147  break;
148  default:
149  ARM_COMPUTE_ERROR("Not handled");
150  }
151  }
152 
153  // Configure kernel window
154  Window win;
155  win.set(Window::DimX, Window::Dimension(0, total_valid_width + valid_height));
156  win.set(Window::DimY, Window::Dimension(0, 1, 1));
157  win.use_tensor_dimensions(tensor->tensor_shape(), Window::DimZ);
158  ICLKernel::configure_internal(win);
159 
160  // Set config_id for enabling LWS tuning
161  _config_id = kernel_name;
162  _config_id += "_";
163  _config_id += lower_string(string_from_data_type(dt));
164  _config_id += "_";
165  _config_id += support::cpp11::to_string(tensor->dimension(0));
166  _config_id += "_";
167  _config_id += support::cpp11::to_string(tensor->dimension(1));
168  _config_id += "_";
169  _config_id += lower_string(string_from_border_mode(border_mode));
171 }
unsigned int top
top of the border
Definition: Types.h:375
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:489
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352
1 channel, 1 U8 per channel
std::string to_string(T &&value)
Convert integer and float values to string.
half_float::half half
16-bit floating point type
Definition: Types.h:46
1 channel, 1 F32 per channel
#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
1 channel, 1 U16 per channel
unsigned int bottom
bottom of the border
Definition: Types.h:377
std::string lower_string(const std::string &val)
Lower a given string.
Definition: Utils.cpp:326
1 channel, 1 F16 per channel
DataType dt
const std::string & string_from_border_mode(BorderMode border_mode)
Translates a given border mode policy to a string.
Definition: Utils.cpp:199
1 channel, 1 S32 per channel
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:403
const std::string & string_from_data_type(DataType dt)
Convert a data type identity into a string.
Definition: Utils.cpp:135
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
Definition: Window.h:43
static constexpr unsigned int num_arguments_per_3D_tensor()
Returns the number of arguments enqueued per 3D tensor object.
Definition: ICLKernel.h:214
1 channel, 1 U32 per channel
quantized, asymmetric fixed-point 8-bit number unsigned
std::string kernel_name
std::string get_cl_type_from_data_type(const DataType &dt)
Translates a tensor data type to the appropriate OpenCL type.
Definition: CLHelpers.cpp:37
virtual BorderSize border_size() const
The size of the border for that kernel.
Definition: IKernel.cpp:46
unsigned int left
left of the border
Definition: Types.h:378
unsigned int right
right of the border
Definition: Types.h:376
1 channel, 1 S16 per channel
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:504
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Definition: Window.h:45
constexpr bool empty() const
Check if the entire border is zero.
Definition: Types.h:300
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Definition: Window.h:47
Borders are left undefined.
quantized, asymmetric fixed-point 8-bit number signed
DataType
Available data types.
Definition: Types.h:77
signed 8-bit number
void limit(const BorderSize &limit)
Limit this border size.
Definition: Types.h:367

References CLBuildOptions::add_option(), ValidRegion::anchor, ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON, IKernel::border_size(), BorderSize::bottom, arm_compute::CONSTANT, arm_compute::create_kernel(), ITensorInfo::data_type(), ITensorInfo::dimension(), Window::DimX, Window::DimY, Window::DimZ, dt, BorderSize::empty(), arm_compute::F16, arm_compute::F32, arm_compute::get_cl_type_from_data_type(), arm_compute::get_padding_info(), arm_compute::has_padding_changed(), kernel_name, BorderSize::left, BorderSize::limit(), arm_compute::lower_string(), ICLKernel::num_arguments_per_3D_tensor(), ITensorInfo::num_channels(), CLBuildOptions::options(), ITensorInfo::padding(), arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, BorderSize::right, arm_compute::S16, arm_compute::S32, arm_compute::S8, Window::set(), ValidRegion::shape, arm_compute::string_from_border_mode(), arm_compute::string_from_data_type(), ITensorInfo::tensor_shape(), arm_compute::support::cpp11::to_string(), BorderSize::top, arm_compute::U16, arm_compute::U32, arm_compute::U8, arm_compute::UNDEFINED, Window::use_tensor_dimensions(), and ITensorInfo::valid_region().

◆ is_parallelisable()

bool is_parallelisable ( ) const
overridevirtual

Indicates whether or not the kernel is parallelisable.

If the kernel is parallelisable then the window returned by window() can be split into sub-windows which can then be run in parallel.

If the kernel is not parallelisable then only the window returned by window() can be passed to run()

Returns
True if the kernel is parallelisable

Reimplemented from IKernel.

Definition at line 44 of file CLFillBorderKernel.cpp.

45 {
46  return false;
47 }

◆ operator=() [1/2]

CLFillBorderKernel& operator= ( const CLFillBorderKernel )
delete

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

◆ operator=() [2/2]

CLFillBorderKernel& operator= ( CLFillBorderKernel &&  )
default

Allow instances of this class to be moved.

◆ 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 198 of file CLFillBorderKernel.cpp.

199 {
200  // Border mode undefined or border width == 0
201  if(_kernel() == nullptr)
202  {
203  return;
204  }
205 
208 
210  Window slice = collapsed.first_slice_window_3D();
211 
212  do
213  {
214  unsigned int idx = 0;
215  add_3D_tensor_argument(idx, _tensor, slice);
216  enqueue(queue, *this, slice, lws_hint());
217  }
218  while(collapsed.slide_window_slice_3D(slice));
219 }
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
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:32
cl::NDRange lws_hint() const
Return the Local-Workgroup-Size hint.
Definition: ICLKernel.h:276
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:172
#define ARM_COMPUTE_ERROR_ON_MISMATCHING_WINDOWS(f, w)
Definition: Validate.h:179
Window collapse_if_possible(const Window &full_window, size_t first, size_t last, bool *has_collapsed=nullptr) const
Collapse the dimensions between first and last if possible.
Definition: Window.inl:68
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
Definition: Validate.h:915
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Definition: Window.h:47
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)

References ICLKernel::add_3D_tensor_argument(), ARM_COMPUTE_ERROR_ON_MISMATCHING_WINDOWS, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, Window::collapse_if_possible(), Window::DimZ, 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().

Referenced by arm_compute::test::validation::DATA_TEST_CASE().

◆ run_op()

void run_op ( ITensorPack tensors,
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]tensorsA vector containing the tensors to operato on.
[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 173 of file CLFillBorderKernel.cpp.

174 {
175  // Border mode undefined or border width == 0
176  if(_kernel() == nullptr)
177  {
178  return;
179  }
180 
181  const auto tensor = utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC));
182 
185 
187  Window slice = collapsed.first_slice_window_3D();
188 
189  do
190  {
191  unsigned int idx = 0;
192  add_3D_tensor_argument(idx, tensor, slice);
193  enqueue(queue, *this, slice, lws_hint());
194  }
195  while(collapsed.slide_window_slice_3D(slice));
196 }
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
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:32
cl::NDRange lws_hint() const
Return the Local-Workgroup-Size hint.
Definition: ICLKernel.h:276
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:172
#define ARM_COMPUTE_ERROR_ON_MISMATCHING_WINDOWS(f, w)
Definition: Validate.h:179
Window collapse_if_possible(const Window &full_window, size_t first, size_t last, bool *has_collapsed=nullptr) const
Collapse the dimensions between first and last if possible.
Definition: Window.inl:68
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
Definition: Validate.h:915
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Definition: Window.h:47
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)

References arm_compute::ACL_SRC, ICLKernel::add_3D_tensor_argument(), ARM_COMPUTE_ERROR_ON_MISMATCHING_WINDOWS, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, Window::collapse_if_possible(), Window::DimZ, arm_compute::enqueue(), Window::first_slice_window_3D(), ITensorPack::get_const_tensor(), ICLKernel::lws_hint(), arm_compute::test::validation::reference::slice(), Window::slide_window_slice_3D(), and IKernel::window().

◆ set_constant_border()

void set_constant_border ( unsigned int  idx,
const PixelValue constant_border_value 
)

Function to set the constant value on fill border kernel depending on type.

Parameters
[in]idxIndex of the kernel argument to set.
[in]constant_border_valueConstant value to use for borders if border_mode is set to CONSTANT.

Definition at line 50 of file CLFillBorderKernel.cpp.

51 {
52  T value;
53  constant_border_value.get(value);
54  ICLKernel::add_argument<T>(idx, static_cast<T>(value));
55 }

References PixelValue::get().


The documentation for this class was generated from the following files: