24.02.1
|
Go to the documentation of this file.
40 : _memory_group(std::move(memory_manager)),
41 _output_stage_kernel(),
43 _input_border_handler(),
44 _activationlayer_function(),
47 _is_activationlayer_enabled(false),
49 _is_padding_required()
63 _output_stage_kernel = std::make_unique<kernels::CpuDirectConv2dOutputStageKernel>();
64 _conv_kernel = std::make_unique<kernels::CpuDirectConv2dKernel>();
65 _input_border_handler = std::make_unique<NEFillBorderKernel>();
68 if (_accumulator.
buffer() !=
nullptr)
76 _has_bias = (
bias !=
nullptr);
81 _output_stage_kernel->configure(
dst,
bias);
83 _is_padding_required = !_conv_kernel->border_size().empty();
85 if (_is_padding_required)
93 _is_activationlayer_enabled =
act_info.enabled();
94 if (_is_activationlayer_enabled)
96 _activationlayer_function = std::make_unique<CpuActivation>();
121 "Biases size and number of input feature maps should match");
144 if (_is_padding_required)
161 if (_is_activationlayer_enabled)
166 _activationlayer_function->run(
pack);
@ NCHW
Num samples, channels, height, width.
@ CONSTANT
Pixels outside the image are assumed to have a constant value.
SimpleTensor< float > src
Class describing the value of a pixel for any image format.
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.
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ActivationLayerInfo &act_info)
Static function to check if given info will lead to a valid configuration.
void add_tensor(int id, ITensor *tensor)
Add tensor to the pack.
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
void configure(ITensorInfo *src, ITensorInfo *weights, const ITensorInfo *bias, ITensorInfo *dst, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Set the input, weights, biases and output tensors.
static Status validate(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *bias, const ITensorInfo *dst, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration.
#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.
Activation Layer Information class.
#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.
TensorAllocator * allocator()
Return a pointer to the tensor's allocator.
static IScheduler & get()
Access the scheduler singleton.
uint8_t * buffer() const override
Interface to be implemented by the child class to return a pointer to CPU memory.
void run(ITensorPack &tensors) override
Run the kernels contained in the function.
static Status validate(const ITensorInfo *src, const ITensorInfo *bias=nullptr, const ITensorInfo *dst=nullptr, const DirectConvolutionLayerOutputStageKernelInfo &info=DirectConvolutionLayerOutputStageKernelInfo())
Static function to check if given info will lead to a valid configuration.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
CpuDirectConv2d(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Store the tensor's metadata.
Describe a multidimensional execution window.
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
Memory group resources scope handling class.
Copyright (c) 2017-2024 Arm Limited.
static Status validate(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
Static function to check if given info will lead to a valid configuration.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
void free() override
Free allocated CPU memory.
@ UNKNOWN
Unknown data layout.
Store the tensor's metadata.
#define ARM_COMPUTE_LOG_PARAMS(...)
DataType
Available data types.