• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
7 #include <armnn/backends/IBackendInternal.hpp>
8 #include <armnn/utility/PolymorphicDowncast.hpp>
9 
10 namespace armnn
11 {
12 
MockImportBackendId()13 constexpr const char* MockImportBackendId() { return "MockRef"; }
14 
15 class MockImportBackendInitialiser
16 {
17 public:
18     MockImportBackendInitialiser();
19     ~MockImportBackendInitialiser();
20 };
21 
22 class MockImportBackend : public IBackendInternal
23 {
24 public:
25     MockImportBackend()  = default;
26     ~MockImportBackend() = default;
27 
28     static const BackendId& GetIdStatic();
GetId() const29     const BackendId& GetId() const override { return GetIdStatic(); }
30 
31     IBackendInternal::IMemoryManagerUniquePtr CreateMemoryManager() const override;
32 
33     IBackendInternal::IWorkloadFactoryPtr CreateWorkloadFactory(
34         const IBackendInternal::IMemoryManagerSharedPtr& memoryManager = nullptr) const override;
35 
36     IBackendInternal::IWorkloadFactoryPtr CreateWorkloadFactory(
37         class TensorHandleFactoryRegistry& tensorHandleFactoryRegistry) const override;
38 
39     IBackendInternal::IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const override;
40 
41     IBackendInternal::IBackendProfilingContextPtr CreateBackendProfilingContext(
42         const IRuntime::CreationOptions& creationOptions, IBackendProfilingPtr& backendProfiling) override;
43 
44     IBackendInternal::ILayerSupportSharedPtr GetLayerSupport() const override;
45 
46     OptimizationViews OptimizeSubgraphView(const SubgraphView& subgraph) const override;
47 
48     std::vector<ITensorHandleFactory::FactoryId> GetHandleFactoryPreferences() const override;
49 
50     void RegisterTensorHandleFactories(class TensorHandleFactoryRegistry& registry) override;
51 };
52 
53 } // namespace armnn
54