47 void options_add_matrix(std::set<std::string> &options,
const std::array<float, 9> &matrix)
49 for(
size_t i = 0; i < 6; ++i)
51 std::stringstream mat_str;
52 mat_str <<
"-DMAT" << i <<
"=" << matrix[i] <<
" ";
53 options.insert(mat_str.str());
78 std::set<std::string> options;
79 options_add_matrix(options, matrix);
84 std::transform(interpolation_name.begin(), interpolation_name.end(), interpolation_name.begin(),
::tolower);
85 const std::string
kernel_name =
"warp_affine_" + interpolation_name;
86 _kernel =
create_kernel(compile_context, kernel_name, options);
108 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)
InterpolationPolicy
Interpolation method.
void configure(const ICLTensor *input, ICLTensor *output, const std::array< float, 9 > &matrix, InterpolationPolicy policy)
Initialize the function's source, destination, interpolation policy and border_mode.
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
Container for 2D border size.
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.
unsigned int bottom
bottom of the border
std::string lower_string(const std::string &val)
Lower a given string.
BorderSize border_size() const override
The size of the border for that kernel.
Copyright (c) 2017-2021 Arm Limited.
Implementation of a static rectangular access pattern.
std::string tolower(std::string string)
Convert string to lower case.
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.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
auto ceil_to_multiple(S value, T divisor) -> decltype(((value+divisor - 1)/divisor) *divisor)
Computes the smallest number larger or equal to value that is a multiple of divisor.
Class to describe a number of elements in each dimension.
Implementation of a row access pattern.
const std::string & string_from_interpolation_policy(InterpolationPolicy policy)
Translates a given interpolation policy to a string.
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.
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
unsigned int right
right of the border
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
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
Container for valid region of a window.
Describe a multidimensional execution window.