59 constant_border_value.
get(value);
60 _kernel.set_argument(idx, static_cast<T>(value));
81 std::set<std::string> build_opts;
92 build_opts.emplace(
"#define FILL_IMAGE_BORDERS_REPLICATE\n");
96 build_opts.emplace(
"#define FILL_IMAGE_BORDERS_CONSTANT\n");
102 build_opts.emplace(
"#define DATA_TYPE_FP16");
106 build_opts.emplace(
"#define DATA_TYPE_FP32");
121 const unsigned int total_valid_width = border_size.
left + valid_width + border_size.
right;
125 _kernel.set_argument(idx++, valid_width);
126 _kernel.set_argument(idx++, valid_height);
132 set_constant_border<float>(idx++, constant_border_value);
141 IGCKernel::configure(win);
147 if(_kernel.get_program() == 0)
160 unsigned int idx = 0;
163 _kernel.update_shader_params();
BorderMode
Methods available to handle borders.
GCFillBorderKernel()
Default constructor.
unsigned int top
top of the border
Class describing the value of a pixel for any image format.
const Window & window() const
The maximum window the kernel can be executed on.
void add_3D_tensor_argument(unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window)
Add the passed 3D tensor's parameters to the object's kernel's arguments starting from the index idx...
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.
TensorShape shape
Shape of the valid region.
Container for 2D border size.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
void get(uint8_t &v) const
Interpret the pixel value as a U8.
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.
void set_constant_border(unsigned int idx, const PixelValue &constant_border_value)
Function to set the constant value on fill border kernel depending on type.
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.
void run(const Window &window) override
Enqueue the OpenGL ES shader to process the given window.
Interface for GLES Compute tensor.
Describe one of the image's dimensions with a start, end and step.
unsigned int bottom
bottom of the border
unsigned int num_arguments_per_3D_tensor() const
Returns the number of arguments enqueued per 3D tensor object.
std::string lower_string(const std::string &val)
Lower a given string.
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
virtual ValidRegion valid_region() const =0
Valid region of the tensor.
const std::string & string_from_border_mode(BorderMode border_mode)
Translates a given border mode policy to a string.
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
#define ARM_COMPUTE_ERROR_ON_MISMATCHING_WINDOWS(f, w)
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
Manages all the GLES kernels compilation and caching, provides accessors for the GLES Context...
void configure(const IGCTensor *tensor, BorderSize border_size, BorderMode border_mode, const PixelValue &constant_border_value=PixelValue())
Initialise the kernel's input, output and border mode.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
virtual BorderSize border_size() const
The size of the border for that kernel.
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
virtual PaddingSize padding() const =0
Padding of tensor.
unsigned int left
left of the border
bool slide_window_slice_3D(Window &slice) const
Slide the passed 3D window slice.
unsigned int right
right of the border
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Wrapper to configure the Khronos EGL and OpenGL ES C header.
static GCKernelLibrary & get()
Get the static instance of GCKernelLibrary.
constexpr bool empty() const
Check if the entire border is zero.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Borders are left undefined.
Pixels outside the image are assumed to have the same value as the closest image pixel.
Common interface for all the GLES kernels.
GCKernel create_kernel(const std::string &shader_name, const StringSet &build_options_set={}) const
Creates a kernel from the kernel library.
Window first_slice_window_3D() const
First 3D slice of the window.
Describe a multidimensional execution window.
virtual size_t num_channels() const =0
The number of channels for each tensor element.
void limit(const BorderSize &limit)
Limit this border size.
Coordinates anchor
Anchor for the start of the valid region.
bool is_parallelisable() const override
Indicates whether or not the kernel is parallelisable.
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)