24.02.1
|
Go to the documentation of this file.
48 const ITensorInfo *weights,
49 const ITensorInfo *
dst,
51 const DirectConvComputeKernelInfo &desc)
58 "Weights feature map dimension should match the respective src's one");
61 "M0 can only be greater than 0 and less than or equal to 8");
64 if (
dst->total_size() != 0)
69 weights->tensor_shape(),
conv_info, desc));
110 ICLKernel::configure_internal(win);
115 kernel_name <<
"indirect_convolution_address_precalculation";
117 const unsigned int pad_left =
conv_info.pad_left();
118 const unsigned int pad_top =
conv_info.pad_top();
119 const unsigned int conv_stride_x = std::get<0>(
conv_info.stride());
120 const unsigned int conv_stride_y = std::get<1>(
conv_info.stride());
121 const auto dst_data_type =
dst->data_type();
156 cl::CommandQueue &queue)
166 unsigned int idx = 0;
Class to describe a number of elements in each dimension.
std::string to_string(T &&value)
Convert integer and float values to string.
SimpleTensor< float > src
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
static Status validate(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info, const DirectConvComputeKernelInfo &desc)
Static function to check if given info will lead to a valid configuration.
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
@ NHWC
Num samples, height, width, channels.
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
TensorShape compute_indirect_buffer_shape(const TensorShape &input_shape, DataLayout input_data_layout, const TensorShape &weights_shape, const PadStrideInfo &conv_info, const DirectConvComputeKernelInfo &desc)
Calculate the indirect buffer output shape used by the indirect convolution function.
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
std::string upper_string(const std::string &val)
Raise a given string to upper case.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context.
#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.
void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override
Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
#define ARM_COMPUTE_ERROR_THROW_ON(status)
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)
int32_t m0
Number of rows to be processed by the kernel.
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_LAYOUT_NOT_IN(t,...)
Window first_slice_window_3D() const
First 3D slice of the window.
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.
void configure(const CLCompileContext &compile_context, ITensorInfo *src, ITensorInfo *weights, ITensorInfo *dst, const PadStrideInfo &conv_info, const DirectConvComputeKernelInfo &desc)
Set the src, weights, biases and dst tensors info.
void add_4d_tensor_nhwc_argument(unsigned int &idx, const ICLTensor *tensor)
Add the passed NHWC 4D tensor's parameters to the object's kernel's arguments by passing strides,...
Describe a multidimensional execution window.
@ ELEMENTWISE
Elementwise CL kernel type.
ClIndirectConv2dAddressPrecalculationKernel()
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
Copyright (c) 2017-2024 Arm Limited.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...)
@ F16
16-bit floating-point number
@ S32
signed 32-bit number
Store the tensor's metadata.
@ F32
32-bit floating-point number
TensorShape compute_deep_convolution_shape(const TensorShape &input_shape, DataLayout input_data_layout, const TensorShape &weights_shape, const PadStrideInfo &conv_info)
Calculate the deep convolution shape output shape of a tensor.
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)
Compute descriptor used by the direct convolution kernel.
std::set< std::string > build_options
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.