24.02
|
Go to the documentation of this file.
34 #include "src/core/NEON/kernels/convolution/common/utils.hpp"
42 struct NEWinogradConvolutionLayer::Impl
44 MemoryGroup memory_group{};
45 std::unique_ptr<cpu::CpuWinogradConv2d> op{
nullptr};
46 ITensorPack run_pack{};
47 ITensorPack prep_pack{};
48 WorkspaceData<Tensor> workspace{};
50 const ITensor *original_weights{
nullptr};
51 bool is_prepared{
false};
52 bool is_activationlayer_enabled{
false};
57 : _impl(std::make_unique<Impl>())
70 bool enable_fast_math)
72 _impl->original_weights = weights;
73 _impl->op = std::make_unique<cpu::CpuWinogradConv2d>();
74 _impl->op->configure(
input->info(), weights->
info(), biases !=
nullptr ? biases->
info() :
nullptr, output->
info(),
77 _impl->aux_mem_req = _impl->op->workspace();
81 manage_workspace<Tensor>(_impl->aux_mem_req, _impl->memory_group, _impl->run_pack, _impl->prep_pack);
89 _impl->op->run(_impl->run_pack);
98 bool enable_fast_math)
105 if (!_impl->is_prepared)
107 _impl->op->prepare(_impl->prep_pack);
108 _impl->original_weights->mark_as_unused();
111 release_temporaries<Tensor>(_impl->aux_mem_req, _impl->workspace);
113 _impl->is_prepared =
true;
std::vector< MemoryInfo > MemoryRequirements
DataLayout
[DataLayout enum definition]
static Status validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo(), bool enable_fast_math=false)
Static function to check if given info will lead to a valid configuration of NEWinogradConvolutionLay...
Interface for CPU tensor.
NEWinogradConvolutionLayer(const std::shared_ptr< IMemoryManager > &memory_manager=nullptr)
Constructor.
constexpr auto data_layout
Activation Layer Information class.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
void prepare() override
Prepare the function for executing.
Memory group resources scope handling class.
Copyright (c) 2017-2024 Arm Limited.
void configure(const ITensor *input, const ITensor *weights, const ITensor *biases, ITensor *output, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo(), bool enable_fast_math=false)
Set the input and output tensors.
Store the tensor's metadata.
void run() override
Run the kernels contained in the function.
static Status validate(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *dst, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo(), bool enable_fast_math=false)
Static function to check if given info will lead to a valid configuration of CpuWinogradConv2d.
~NEWinogradConvolutionLayer()
Destructor.