24.02
|
Go to the documentation of this file.
38 struct NEGEMMConvolutionLayer::Impl
40 const ITensor *weights{
nullptr};
41 std::unique_ptr<cpu::CpuGemmConv2d> op{
nullptr};
42 ITensorPack run_pack{};
43 MemoryGroup memory_group{};
44 IWeightsManager *weights_manager{
nullptr};
46 WorkspaceData<Tensor> workspace_tensors{};
47 bool is_prepared{
false};
52 : _impl(std::make_unique<Impl>())
54 _impl->weights_manager = weights_manager;
67 bool enable_fast_math,
72 _impl->weights = weights;
73 _impl->op = std::make_unique<cpu::CpuGemmConv2d>();
74 _impl->op->configure(
input->info(), weights->
info(), (biases !=
nullptr ? biases->
info() :
nullptr), output->
info(),
81 _impl->aux_mem_req = _impl->op->workspace();
82 _impl->workspace_tensors =
83 manage_workspace<Tensor>(_impl->aux_mem_req, _impl->memory_group, _impl->run_pack, _impl->run_pack);
94 bool enable_fast_math,
110 const bool enable_fast_math)
113 dilation,
act_info, enable_fast_math);
120 _impl->op->run(_impl->run_pack);
125 if (!_impl->is_prepared)
127 _impl->op->prepare(_impl->run_pack);
130 release_temporaries<Tensor>(_impl->aux_mem_req, _impl->workspace_tensors);
131 _impl->is_prepared =
true;
std::vector< MemoryInfo > MemoryRequirements
Convolution Layer Weights Information class.
SimpleTensor< float > src
static Status validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const PadStrideInfo &conv_info, const WeightsInfo &weights_info=WeightsInfo(), const Size2D &dilation=Size2D(1U, 1U), const ActivationLayerInfo &act_info=ActivationLayerInfo(), bool enable_fast_math=false, unsigned int num_groups=1)
Static function to check if given info will lead to a valid configuration of NEGEMMConvolutionLayer.
Class for specifying the size of an image or rectangle.
Interface for CPU tensor.
void run() override
Run the kernels contained in the function.
Activation Layer Information class.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
WeightFormat
Memory layouts for the weights tensor.
~NEGEMMConvolutionLayer()
Default destructor.
static Status has_opt_impl(arm_compute::WeightFormat &expected_weight_format, const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *dst, const PadStrideInfo &conv_info, const WeightsInfo &weights_info=WeightsInfo(), const Size2D &dilation=Size2D(1U, 1U), const ActivationLayerInfo &act_info=ActivationLayerInfo(), bool enable_fast_math=false)
Static function to check if there is an optimized version of GEMM available for the input parameters.
NEGEMMConvolutionLayer(const std::shared_ptr< IMemoryManager > &memory_manager=nullptr, IWeightsManager *weights_manager=nullptr)
Constructor.
const unsigned int num_groups
Memory group resources scope handling class.
Copyright (c) 2017-2024 Arm Limited.
Store the tensor's metadata.
void prepare() override
Prepare the function for executing.
static Status has_opt_impl(arm_compute::WeightFormat &expected_weight_format, const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const PadStrideInfo &conv_info, const WeightsInfo &weights_info=WeightsInfo(), const Size2D &dilation=Size2D(1U, 1U), const ActivationLayerInfo &act_info=ActivationLayerInfo(), const bool enable_fast_math=false)
Indicates whether or not there is an optimal assembly implementation that can be used to process the ...
void configure(const ITensor *input, const ITensor *weights, const ITensor *biases, ITensor *output, const PadStrideInfo &conv_info, const WeightsInfo &weights_info=WeightsInfo(), const Size2D &dilation=Size2D(1U, 1U), const ActivationLayerInfo &act_info=ActivationLayerInfo(), bool enable_fast_math=false, unsigned int num_groups=1)
Set the input and output tensors.
Weights manager interface to handle weights transformations.
static Status validate(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const PadStrideInfo &conv_info, const WeightsInfo &weights_info=WeightsInfo(), const Size2D &dilation=Size2D(1U, 1U), const ActivationLayerInfo &act_info=ActivationLayerInfo(), bool enable_fast_math=false, unsigned int num_groups=1)
Static function to check if given info will lead to a valid configuration.