45 : _input1(nullptr), _input2(nullptr), _output(nullptr), _sensitivity(), _strength_thresh(), _norm_factor(), _border_size(0)
55 int32_t block_size,
float norm_factor,
float strength_thresh,
float sensitivity,
56 bool border_undefined)
58 configure(
CLKernelLibrary::get().get_compile_context(), input1, input2, output, block_size, norm_factor, strength_thresh, sensitivity, border_undefined);
62 int32_t block_size,
float norm_factor,
float strength_thresh,
float sensitivity,
63 bool border_undefined)
78 _sensitivity = sensitivity;
79 _strength_thresh = strength_thresh;
80 _norm_factor = norm_factor;
84 std::stringstream harris_score_kernel_name;
85 harris_score_kernel_name <<
"harris_score_" << block_size <<
"x" << block_size;
91 _kernel =
create_kernel(compile_context, harris_score_kernel_name.str(), build_opts);
95 _kernel.setArg(idx++, sensitivity);
96 _kernel.setArg(idx++, strength_thresh);
97 _kernel.setArg(idx++, norm_factor);
101 constexpr
unsigned int num_elems_written_per_iteration = 4;
102 const unsigned int num_elems_read_per_iteration = block_size == 7 ? 10 : 8;
103 const unsigned int num_rows_read_per_iteration = block_size;
114 output_access.set_valid_region(win, valid_region, border_undefined,
border_size());
116 ICLKernel::configure_internal(win);
119 _config_id = harris_score_kernel_name.str();
142 unsigned int idx = 0;
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 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.
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 size_t dimension(size_t index) const =0
Return the size of the requested dimension.
#define ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(t)
Container for 2D border size.
cl::NDRange lws_hint() const
Return the Local-Workgroup-Size hint.
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.
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.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
std::string lower_string(const std::string &val)
Lower a given string.
const ValidRegion valid_region
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.
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.
#define ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(...)
Class to describe a number of elements in each dimension.
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.
ValidRegion intersect_valid_regions(const Ts &... regions)
Intersect multiple valid regions.
static constexpr unsigned int num_arguments_per_2D_tensor()
Returns the number of arguments enqueued per 2D tensor object.
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 ICLImage *input1, const ICLImage *input2, ICLImage *output, int32_t block_size, float norm_factor, float strength_thresh, float sensitivity, bool border_undefined)
Setup the kernel parameters.
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...
Interface for OpenCL tensor.
CLHarrisScoreKernel()
Default constructor.
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context...
Wrapper to configure the Khronos OpenCL C++ header.
unsigned int num_elems_processed_per_iteration
Container for valid region of a window.
Describe a multidimensional execution window.
BorderSize border_size() const override
The size of the border for that kernel.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)