ArmNN
 25.11
Loading...
Searching...
No Matches
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
16namespace armnn
17{
18
19using PreCompiledObjectDeleter = std::function<void(const void*)>;
20using PreCompiledObjectPtr = std::unique_ptr<void, PreCompiledObjectDeleter>;
21
22class PreCompiledLayer : public LayerWithParameters<PreCompiledDescriptor>
23{
24public:
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
38private:
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
LayerWithParameters(unsigned int numInputSlots, unsigned int numOutputSlots, LayerType type, const PreCompiledDescriptor &param, const char *name)
void SetPreCompiledObject(PreCompiledObjectPtr preCompiledObject)
PreCompiledLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
void ValidateTensorShapesFromInputs() override
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
PreCompiledLayer(const PreCompiledDescriptor &param, const char *name)
Copyright (c) 2021 ARM Limited and Contributors.
std::unique_ptr< void, PreCompiledObjectDeleter > PreCompiledObjectPtr
std::function< void(const void *)> PreCompiledObjectDeleter
A PreCompiledDescriptor for the PreCompiledLayer.