23.11
|
Go to the documentation of this file.
49 const ITensorInfo *src2,
50 const ITensorInfo *src3,
51 const ITensorInfo *src4,
52 const ITensorInfo *
dst)
100 const unsigned int min_dimension =
117 src3->
dimension(0) - vec_size_leftover) %
126 const bool have_different_qinfo =
162 _config_id =
"concatenate_width_x4_";
201 unsigned int idx = 0;
207 _kernel.setArg<cl_int>(idx++, _depth);
208 _kernel.setArg<cl_int>(idx++, _input1_width);
209 _kernel.setArg<cl_int>(idx++, _input2_width);
210 _kernel.setArg<cl_int>(idx++, _input3_width);
Class to describe a number of elements in each dimension.
std::string to_string(T &&value)
Convert integer and float values to string.
ClWidthConcatenate4TensorsKernel()
const StringSet & options() const
Gets the current options list set.
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
std::string lower_string(const std::string &val)
Lower a given string.
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
virtual size_t element_size() const =0
Element size in bytes calculated as data_size() * num_channels()
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
const std::string & string_from_data_type(DataType dt)
Convert a data type identity into a string.
std::string upper_string(const std::string &val)
Raise a given string to upper case.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context.
bool tensors_have_different_quantization_info(const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos)
Checks if the quantization info of given tensors are different.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
const ITensor * get_const_tensor(int id) const
Get constant tensor of a given id.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
void add_option(std::string option)
Adds option to the existing build option list.
Window collapse(const Window &full_window, size_t first, size_t last=Coordinates::num_max_dimensions) const
Collapse the dimensions between first and last.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
#define ARM_COMPUTE_RETURN_ERROR_ON_F16_UNSUPPORTED(tensor)
static Status validate(const ITensorInfo *src1, const ITensorInfo *src2, const ITensorInfo *src3, const ITensorInfo *src4, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration.
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.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
std::string float_to_string_with_full_precision(float val)
Create a string with the float in full precision.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
void configure(const CLCompileContext &compile_context, ITensorInfo *src1, ITensorInfo *src2, ITensorInfo *src3, ITensorInfo *src4, ITensorInfo *dst)
Initialise the kernel's sources and destination.
UniformQuantizationInfo uniform() const
Return per layer quantization info.
void run_op(ITensorPack &tensors, const Window &window, ::cl::CommandQueue &queue) override
void add_4D_tensor_argument(unsigned int &idx, const ICLTensor *tensor, const Window &window)
Add the passed 4D tensor's parameters to the object's kernel's arguments starting from the index idx.
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
const Window & window() const
The maximum window the kernel can be executed on.
std::string get_cl_type_from_data_type(const DataType &dt)
Translates a tensor data type to the appropriate OpenCL type.
Describe a multidimensional execution window.
@ ELEMENTWISE
Elementwise CL kernel type.
Copyright (c) 2017-2023 Arm Limited.
unsigned int adjust_vec_size(unsigned int vec_size, size_t dim0)
Returns the adjusted vector size in case it is less than the input's first dimension,...
bool has_padding_changed(const std::unordered_map< const ITensorInfo *, PaddingSize > &padding_map)
Check if the previously stored padding info has changed after configuring a kernel.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
cl::NDRange lws_hint() const
Return the Local-Workgroup-Size hint.
bool is_data_type_quantized_asymmetric(DataType dt)
Check if a given data type is of asymmetric quantized type.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
Store the tensor's metadata.
Window first_slice_window_4D() const
First 4D slice of the window.
@ UNKNOWN
Unknown data type.
bool slide_window_slice_4D(Window &slice) const
Slide the passed 4D window slice.
unsigned int num_elems_processed_per_iteration
std::unordered_map< const ITensorInfo *, PaddingSize > get_padding_info(std::initializer_list< const ITensorInfo * > infos)
Stores padding information before configuring a kernel.
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)
static constexpr size_t num_max_dimensions
Number of dimensions the tensor has.
void enqueue(cl::CommandQueue &queue, ICLKernel &kernel, const Window &window, const cl::NDRange &lws_hint=CLKernelLibrary::get().default_ndrange(), bool use_dummy_work_items=false)
Add the kernel to the command queue with the given window.