24.02.1
|
Go to the documentation of this file.
71 const unsigned int num_elems_per_src_plane = original_src_shape[
width_idx] * original_src_shape[
height_idx];
72 const unsigned int num_channels = original_src_shape[
channel_idx];
88 ICLKernel::configure_internal(win);
106 if (
dst->total_size() != 0)
125 unsigned int idx = 0;
Class to describe a number of elements in each dimension.
@ NCHW
Num samples, channels, height, width.
std::string to_string(T &&value)
Convert integer and float values to string.
SimpleTensor< float > src
DataLayout
[DataLayout enum definition]
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)
@ NHWC
Num samples, height, width, channels.
ClConvertFullyConnectedWeightsKernel()
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context.
constexpr auto data_layout
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.
#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)
size_t total_size_lower(size_t dimension) const
Compute size of dimensions lower than the given one.
void add_option(std::string option)
Adds option to the existing build option list.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
bool auto_init_if_empty(ITensorInfo &info, const TensorShape &shape, int num_channels, DataType data_type, QuantizationInfo quantization_info=QuantizationInfo())
Auto initialize the tensor info (shape, number of channels and data type) if the current assignment i...
#define ARM_COMPUTE_RETURN_ERROR_ON_F16_UNSUPPORTED(tensor)
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)
const Window & window() const
The maximum window the kernel can be executed on.
size_t get_data_layout_dimension_index(const DataLayout &data_layout, const DataLayoutDimension &data_layout_dimension)
Get the index of the given dimension.
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, const TensorShape &original_src_shape, DataLayout data_layout)
Static function to check if given info will lead to a valid configuration.
std::string get_cl_unsigned_type_from_element_size(size_t element_size)
Translates the element size to an unsigned integer data type.
void configure(const CLCompileContext &compile_context, const ITensorInfo *src, ITensorInfo *dst, const TensorShape &original_src_shape, DataLayout data_layout)
Set the src and dst tensor.
Describe a multidimensional execution window.
@ ELEMENTWISE
Elementwise CL kernel type.
Copyright (c) 2017-2024 Arm Limited.
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.
cl::NDRange lws_hint() const
Return the Local-Workgroup-Size hint.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
@ UNKNOWN
Unknown data layout.
Store the tensor's metadata.
@ UNKNOWN
Unknown data type.
void run_op(ITensorPack &tensors, const Window &window, ::cl::CommandQueue &queue) override
std::unordered_map< const ITensorInfo *, PaddingSize > get_padding_info(std::initializer_list< const ITensorInfo * > infos)
Stores padding information before configuring a kernel.
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.