24.02.1
|
Go to the documentation of this file.
40 struct CpuDepthwiseConv2dAssemblyDispatch::LocalImpl
42 std::unique_ptr<kernels::CpuDepthwiseConv2dAssemblyWrapperKernel> asm_kernel{
nullptr};
43 bool is_prepared{
false};
44 bool are_weights_const{
true};
48 #ifndef DOXYGEN_SKIP_THIS
65 _pImpl->is_prepared =
false;
74 auto dwc_wrapper = std::make_unique<kernels::CpuDepthwiseConv2dAssemblyWrapperKernel>();
79 constexpr
size_t alignment = 4096;
80 _pImpl->mem_req.push_back({
TensorType::ACL_INT_0, dwc_wrapper->get_working_size(num_threads), alignment});
82 _pImpl->asm_kernel = std::move(dwc_wrapper);
96 return _pImpl->mem_req;
122 if ((!_pImpl->are_weights_const && weights !=
nullptr) || !_pImpl->is_prepared)
129 const auto bias_ptr = (
bias) ?
bias->buffer() +
bias->info()->offset_first_element_in_bytes() :
nullptr;
133 const auto weights_padding = weights->
info()->
padding();
135 const size_t ld_weights_col = weights_shape[0] + weights_padding.
left + weights_padding.right;
136 const size_t ld_weights_row =
137 ld_weights_col * (weights_shape[1] + weights_padding.top + weights_padding.bottom);
138 _pImpl->asm_kernel->pack_parameters(parameters_ptr, bias_ptr, weights_ptr, ld_weights_col, ld_weights_row);
143 bias->mark_as_unused();
145 _pImpl->is_prepared =
true;
std::vector< MemoryInfo > MemoryRequirements
SimpleTensor< float > src
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
virtual void schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors)=0
Runs the kernel in the same thread as the caller synchronously.
arm_gemm::Activation map_to_arm_gemm_activation(const ActivationLayerInfo &act)
Performs a mapping between Compute Library ActivationLayerInfo and the assembly Activation structure.
CPUInfo & cpu_info()
Get CPU info.
Interface for CPU tensor.
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
void configure(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *bias, ITensorInfo *dst, const ConvolutionInfo &info)
Initialize the function's source, destination, kernels and border_size.
Activation Layer Information class.
bool empty() const
Checks if pack is empty.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
#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_ON_MSG(cond, msg)
void mark_as_unused() const
Marks a tensor as unused.
static IScheduler & get()
Access the scheduler singleton.
static constexpr size_t DimW
Alias for dimension 3 also known as W dimension.
CpuDepthwiseConv2dAssemblyDispatch()
void prepare(ITensorPack &tensors) override
Prepare the function for executing.
static bool is_activation_supported(const ActivationLayerInfo &activation)
Checks if activation is supported by the assembly kernels.
static Status validate(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *bias, const ITensorInfo *dst, const ConvolutionInfo &info)
Indicates whether or not this function can be used to process the given parameters.
experimental::MemoryRequirements workspace() const override
Return the memory requirements required by the workspace.
static Status validate(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *bias, const ITensorInfo *dst, const ConvolutionInfo &info)
Static function to check if given info will lead to a valid configuration.
Copyright (c) 2017-2024 Arm Limited.
unsigned int left
left of the border
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
virtual size_t offset_first_element_in_bytes() const =0
The offset from the beginning of the memory allocation to the first element of the tensor.
virtual unsigned int num_threads() const =0
Returns the number of threads that the SingleThreadScheduler has in its pool.
Store the tensor's metadata.
void run(ITensorPack &tensors) override
Run the kernels contained in the function.
virtual bool are_values_constant() const =0
Flag indicating whether the values of the tensor are constant, meaning that they can change on kernel...
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
#define ARM_COMPUTE_LOG_PARAMS(...)
~CpuDepthwiseConv2dAssemblyDispatch()
virtual uint8_t * buffer() const =0
Interface to be implemented by the child class to return a pointer to CPU memory.
virtual PaddingSize padding() const =0
Padding of tensor.