ArmNN
 24.08
PreCompiledLayer.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
10 
11 #include <armnn/Descriptors.hpp>
12 
13 #include <memory>
14 #include <functional>
15 
16 namespace armnn
17 {
18 
19 using PreCompiledObjectDeleter = std::function<void(const void*)>;
20 using PreCompiledObjectPtr = std::unique_ptr<void, PreCompiledObjectDeleter>;
21 
22 class PreCompiledLayer : public LayerWithParameters<PreCompiledDescriptor>
23 {
24 public:
25  PreCompiledLayer(const PreCompiledDescriptor& param, const char* name);
27 
28  virtual std::unique_ptr<IWorkload> CreateWorkload(const IWorkloadFactory& factory) const override;
29 
30  PreCompiledLayer* Clone(Graph &graph) const override;
31 
32  void ValidateTensorShapesFromInputs() override;
33 
34  void SetPreCompiledObject(PreCompiledObjectPtr preCompiledObject);
35 
36  void ExecuteStrategy(IStrategy& strategy) const override;
37 
38 private:
39  PreCompiledLayer(const PreCompiledLayer& other) = delete;
40  PreCompiledLayer& operator=(const PreCompiledLayer& other) = delete;
41 
42  std::shared_ptr<void> m_PreCompiledObject;
43 };
44 
45 } // namespace armnn
armnn::PreCompiledLayer::CreateWorkload
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Definition: PreCompiledLayer.cpp:31
armnn::PreCompiledObjectDeleter
std::function< void(const void *)> PreCompiledObjectDeleter
Definition: PreCompiledLayer.hpp:19
Descriptors.hpp
armnn::PreCompiledLayer::Clone
PreCompiledLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
Definition: PreCompiledLayer.cpp:24
armnn::PreCompiledObjectPtr
std::unique_ptr< void, PreCompiledObjectDeleter > PreCompiledObjectPtr
Definition: PreCompiledLayer.hpp:20
armnn::IStrategy
Definition: IStrategy.hpp:16
WorkloadFactory.hpp
armnn::LayerWithParameters
Definition: LayerWithParameters.hpp:14
armnn::PreCompiledLayer::~PreCompiledLayer
~PreCompiledLayer()
Definition: PreCompiledLayer.cpp:21
armnn::IWorkloadFactory
Definition: WorkloadFactory.hpp:22
armnn::PreCompiledLayer::PreCompiledLayer
PreCompiledLayer(const PreCompiledDescriptor &param, const char *name)
Definition: PreCompiledLayer.cpp:17
LayerWithParameters.hpp
armnn::PreCompiledLayer
Definition: PreCompiledLayer.hpp:22
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::PreCompiledLayer::SetPreCompiledObject
void SetPreCompiledObject(PreCompiledObjectPtr preCompiledObject)
Definition: PreCompiledLayer.cpp:47
armnn::PreCompiledLayer::ValidateTensorShapesFromInputs
void ValidateTensorShapesFromInputs() override
Definition: PreCompiledLayer.cpp:40
armnn::PreCompiledDescriptor
A PreCompiledDescriptor for the PreCompiledLayer.
Definition: Descriptors.hpp:1367
armnn::PreCompiledLayer::ExecuteStrategy
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
Definition: PreCompiledLayer.cpp:52
armnn::Graph
Definition: Graph.hpp:30