43 : _input(nullptr), _output(nullptr), _multi_input(nullptr), _multi_output(nullptr)
65 num_elems_processed_per_iteration = 16;
80 num_elems_processed_per_iteration = 8;
94 num_elems_processed_per_iteration = 16;
112 kernel_name <<
"_to_";
114 kernel_name <<
"_bt709";
131 ICLKernel::configure_internal(win);
134 _config_id = kernel_name.str();
165 num_elems_processed_per_iteration = 4;
183 kernel_name <<
"_to_";
185 kernel_name <<
"_bt709";
187 _multi_input =
input;
202 sub_sampling, sub_sampling);
204 sub_sampling, sub_sampling);
208 plane0_access, plane1_access, plane2_access,
215 ICLKernel::configure_internal(win);
218 _config_id = kernel_name.str();
244 unsigned int num_elems_read_per_iteration_x = 0;
258 num_elems_processed_per_iteration = 2;
259 num_elems_read_per_iteration_x = 8;
262 num_elems_processed_per_iteration = 4;
263 num_elems_read_per_iteration_x = 16;
278 num_elems_processed_per_iteration = 8;
279 num_elems_read_per_iteration_x = 8;
298 kernel_name <<
"_to_";
300 kernel_name <<
"_bt709";
302 _multi_output = output;
323 output_plane0_access,
324 output_plane1_access,
325 output_plane2_access);
333 ICLKernel::configure_internal(win);
336 _config_id = kernel_name.str();
362 num_elems_processed_per_iteration = 16;
376 num_elems_processed_per_iteration = 16;
394 kernel_name <<
"_to_";
396 kernel_name <<
"_bt709";
398 _multi_input =
input;
399 _multi_output = output;
405 float sub_sampling_input = (has_two_input_planars || (input->
info()->
format() ==
Format::IYUV)) ? 0.5f : 1;
406 float sub_sampling_output = (has_two_output_planars || (output->
info()->
format() ==
Format::IYUV)) ? 0.5f : 1;
415 sub_sampling_input, sub_sampling_input);
417 sub_sampling_input, sub_sampling_input);
424 input_plane0_access, input_plane1_access, input_plane2_access,
425 output_plane0_access, output_plane1_access, output_plane2_access);
433 ICLKernel::configure_internal(win);
436 _config_id = kernel_name.str();
458 if(
nullptr != _input &&
nullptr != _output)
462 unsigned int idx = 0;
469 else if(
nullptr != _input &&
nullptr != _multi_output)
481 unsigned int idx = 0;
492 else if(
nullptr != _multi_input &&
nullptr != _output)
505 unsigned int idx = 0;
517 else if(
nullptr != _multi_input &&
nullptr != _multi_output)
527 win_in_uv.
x().
end() / 2, win_in_uv.
x().
step() / 2));
530 unsigned int idx = 0;
541 win_out_uv.x().end() / 2, win_out_uv.x().step() / 2));
void run(const Window &window, cl::CommandQueue &queue) override
Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue...
Window first_slice_window_2D() const
First 2D slice of the window.
virtual size_t num_dimensions() const =0
The number of dimensions of the tensor (rank)
A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 byte.
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
const Window & window() const
The maximum window the kernel can be executed on.
void enqueue(IGCKernel &kernel, const Window &window, const gles::NDRange &lws=gles::NDRange(1U, 1U, 1U))
Add the kernel to the command queue with the given window.
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
#define ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(t)
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
constexpr int step() const
Return the step of the dimension.
cl::NDRange lws_hint() const
Return the Local-Workgroup-Size hint.
1 channel, 1 U8 per channel
std::string to_string(T &&value)
Convert integer and float values to string.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
Interface for OpenCL multi-planar images.
A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling.
Describe one of the image's dimensions with a start, end and step.
#define ARM_COMPUTE_ERROR_ON_MSG_VAR(cond, msg,...)
virtual ICLImage * cl_plane(unsigned int index)=0
Return a pointer to the requested OpenCL plane of the image.
std::string lower_string(const std::string &val)
Lower a given string.
A 2 plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling.
bool slide_window_slice_2D(Window &slice) const
Slide the passed 2D window slice.
Copyright (c) 2017-2021 Arm Limited.
virtual ValidRegion valid_region() const =0
Valid region of the tensor.
3 channels, 1 U8 per channel
CLColorConvertKernel()
Default constructor.
Implementation of a rectangular access pattern.
virtual Format format() const =0
Colour format of the image.
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.
const std::string & string_from_data_type(DataType dt)
Convert a data type identity into a string.
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
bool update_window_and_padding(Window &win, Ts &&... patterns)
Update window and padding size for each of the access patterns.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
Format
Image colour formats.
Class to describe a number of elements in each dimension.
Implementation of a row access pattern.
A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
ValidRegion intersect_valid_regions(const Ts &... regions)
Intersect multiple valid regions.
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
IImage * plane(unsigned int index) override
Return a pointer to the requested plane of the image.
virtual const MultiImageInfo * info() const =0
Interface to be implemented by the child class to return the multi-planar image's metadata...
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
A 3 plane of 8-bit 4:2:0 sampled Y, U, V planes.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
4 channels, 1 U8 per channel
void set_dimension_step(size_t dimension, int step)
Set the step of a given dimension.
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...
void configure(const ICLTensor *input, ICLTensor *output)
Set the input and output of the kernel.
Interface for OpenCL tensor.
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context...
constexpr const Dimension & y() const
Alias to access the second dimension of the window.
Wrapper to configure the Khronos OpenCL C++ header.
unsigned int num_elems_processed_per_iteration
Container for valid region of a window.
constexpr int end() const
Return the end of the dimension.
A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.
Format format() const
Colour format of the image.
constexpr int start() const
Return the start of the dimension.
Describe a multidimensional execution window.
Coordinates anchor
Anchor for the start of the valid region.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)
constexpr const Dimension & x() const
Alias to access the first dimension of the window.
const std::string & string_from_format(Format format)
Convert a tensor format into a string.