38 : _gx(nullptr), _gy(nullptr), _magnitude(nullptr), _phase(nullptr)
54 "Gx and Gy must have the same pixel size");
56 "Mag must have the same pixel size as Gx and Gy");
64 std::set<std::string> built_opts;
69 const std::string
kernel_name = (norm_type == 1) ? std::string(
"combine_gradients_L1") : std::string(
"combine_gradients_L2");
70 _kernel =
create_kernel(compile_context, kernel_name, built_opts);
87 ICLKernel::configure_internal(win);
107 unsigned int idx = 0;
118 : _magnitude(nullptr), _phase(nullptr), _output(nullptr)
143 std::set<std::string> built_opts;
148 const std::string
kernel_name = std::string(
"suppress_non_maximum");
149 _kernel =
create_kernel(compile_context, kernel_name, built_opts);
153 _kernel.setArg(idx++, lower_thr);
157 constexpr
unsigned int num_elems_read_written_per_iteration = 3;
162 num_elems_read_written_per_iteration, num_elems_read_written_per_iteration);
170 ICLKernel::configure_internal(win);
192 unsigned int idx = 0;
202 : _input(nullptr), _output(nullptr), _lower_thr(0), _upper_thr(0), _visited(nullptr), _recorded(nullptr), _l1_stack(nullptr), _l1_stack_counter(nullptr)
224 _lower_thr = lower_thr;
225 _upper_thr = upper_thr;
227 _recorded = recorded;
228 _l1_stack = l1_stack;
229 _l1_stack_counter = l1_stack_counter;
232 std::set<std::string> built_opts;
237 const std::string
kernel_name = std::string(
"hysteresis");
238 _kernel =
create_kernel(compile_context, kernel_name, built_opts);
244 _kernel.setArg(idx++, static_cast<cl_uint>(_lower_thr));
245 _kernel.setArg(idx++, static_cast<cl_uint>(_upper_thr));
246 _kernel.setArg(idx++, static_cast<cl_uint>(width));
247 _kernel.setArg(idx++, static_cast<cl_uint>(height));
265 l1_stack_counter_access);
271 l1_stack_counter_access.set_valid_region(win, _input->
info()->
valid_region());
273 ICLKernel::configure_internal(win);
299 unsigned int idx = 0;
CLEdgeTraceKernel()
Constructor.
Window first_slice_window_2D() const
First 2D slice of the window.
unsigned int top
top of the border
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 configure(const ICLTensor *magnitude, const ICLTensor *phase, ICLTensor *output, int32_t lower_thr, bool border_undefined)
Initialise the kernel's sources, destination and border mode.
CLEdgeNonMaxSuppressionKernel()
Constructor.
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.
Container for 2D border size.
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.
SimpleTensor< uint8_t > phase(const SimpleTensor< T > &gx, const SimpleTensor< T > &gy, PhaseType phase_type)
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
1 channel, 1 U16 per channel
std::string lower_string(const std::string &val)
Lower a given string.
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.
1 channel, 1 S32 per channel
Implementation of a rectangular access pattern.
void run(const Window &window, cl::CommandQueue &queue) override
Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue...
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.
bool update_window_and_padding(Window &win, Ts &&... patterns)
Update window and padding size for each of the access patterns.
1 channel, 1 U32 per channel
Class to describe a number of elements in each dimension.
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Implementation of a row access pattern.
std::string get_cl_type_from_data_type(const DataType &dt)
Translates a tensor data type to the appropriate OpenCL type.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
size_t data_size_from_type(DataType data_type)
The size in bytes of the data type.
static constexpr unsigned int num_arguments_per_2D_tensor()
Returns the number of arguments enqueued per 2D tensor object.
void run(const Window &window, cl::CommandQueue &queue) override
Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue...
void run(const Window &window, cl::CommandQueue &queue) override
Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue...
unsigned int left
left of the border
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
1 channel, 1 S16 per channel
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
void configure(const ICLTensor *gx, const ICLTensor *gy, ICLTensor *magnitude, ICLTensor *phase, int32_t norm_type)
Initialise the kernel's sources, destinations and border mode.
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, int32_t upper_thr, int32_t lower_thr, ICLTensor *visited, ICLTensor *recorded, ICLTensor *l1_stack, ICLTensor *l1_stack_counter)
Initialise the kernel's source, destination and border mode.
Interface for OpenCL tensor.
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context...
Wrapper to configure the Khronos OpenCL C++ header.
CLGradientKernel()
Constructor.
unsigned int num_elems_processed_per_iteration
Describe a multidimensional execution window.
SimpleTensor< T > magnitude(const SimpleTensor< T > &gx, const SimpleTensor< T > &gy, MagnitudeType magnitude_type)
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)
BorderSize border_size() const override
The size of the border for that kernel.
const std::string & string_from_format(Format format)
Convert a tensor format into a string.