56 unsigned int mask_size,
MatrixPattern pattern,
const uint8_t *mask,
57 bool border_undefined)
63 unsigned int mask_size,
MatrixPattern pattern,
const uint8_t *mask,
64 bool border_undefined)
77 std::set<std::string> build_opts;
82 std::transform(pattern_name.begin(), pattern_name.end(), pattern_name.begin(),
::tolower);
84 ss <<
"non_linear_filter_" << pattern_name << mask_size <<
"x" << mask_size;
87 _kernel =
create_kernel(compile_context, ss.str(), build_opts);
91 constexpr
unsigned int num_elems_read_per_iteration = 16;
92 const unsigned int num_rows_read_per_iteration = mask_size;
103 ICLKernel::configure_internal(win);
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 std::string & string_from_matrix_pattern(MatrixPattern pattern)
Convert a matrix pattern into a string.
Container for 2D border size.
void configure(const ICLTensor *input, ICLTensor *output, NonLinearFilterFunction function, unsigned int mask_size, MatrixPattern pattern, const uint8_t *mask, bool border_undefined)
Set the source, destination and border mode of the kernel.
1 channel, 1 U8 per channel
BorderSize border_size() const override
The size of the border for that kernel.
std::stringstream ss(mlgo_str)
#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.
Copyright (c) 2017-2021 Arm Limited.
virtual ValidRegion valid_region() const =0
Valid region of the tensor.
std::string tolower(std::string string)
Convert string to lower case.
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.
bool update_window_and_padding(Window &win, Ts &&... patterns)
Update window and padding size for each of the access patterns.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Implementation of a row access pattern.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
const std::string & string_from_non_linear_filter_function(NonLinearFilterFunction function)
Translates a given non linear function to a string.
unsigned int left
left of the border
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
CLNonLinearFilterKernel()
Default constructor.
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.
unsigned int num_elems_processed_per_iteration
MatrixPattern
Available matrix patterns.
Any other matrix pattern.
Describe a multidimensional execution window.
NonLinearFilterFunction
Available non linear functions.