Matteo Martincigh | 88054f8 | 2019-05-17 12:15:30 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include <backendsCommon/IBackendInternal.hpp> |
| 9 | #include <backendsCommon/OptimizationViews.hpp> |
David Monahan | 7f2c35a | 2019-05-24 10:46:28 +0100 | [diff] [blame] | 10 | #include <LayerSupportCommon.hpp> |
| 11 | #include <backendsCommon/LayerSupportBase.hpp> |
Matteo Martincigh | 88054f8 | 2019-05-17 12:15:30 +0100 | [diff] [blame] | 12 | |
| 13 | namespace armnn |
| 14 | { |
| 15 | |
| 16 | class MockBackend : public IBackendInternal |
| 17 | { |
| 18 | public: |
| 19 | MockBackend() = default; |
| 20 | ~MockBackend() = default; |
| 21 | |
| 22 | static const BackendId& GetIdStatic(); |
| 23 | const BackendId& GetId() const override { return GetIdStatic(); } |
| 24 | |
| 25 | IBackendInternal::IMemoryManagerUniquePtr CreateMemoryManager() const override; |
| 26 | |
| 27 | IBackendInternal::IWorkloadFactoryPtr CreateWorkloadFactory( |
| 28 | const IBackendInternal::IMemoryManagerSharedPtr& memoryManager = nullptr) const override; |
| 29 | |
| 30 | IBackendInternal::IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const override; |
| 31 | |
| 32 | IBackendInternal::Optimizations GetOptimizations() const override; |
| 33 | IBackendInternal::ILayerSupportSharedPtr GetLayerSupport() const override; |
| 34 | |
| 35 | OptimizationViews OptimizeSubgraphView(const SubgraphView& subgraph) const override; |
| 36 | }; |
| 37 | |
David Monahan | 7f2c35a | 2019-05-24 10:46:28 +0100 | [diff] [blame] | 38 | class MockLayerSupport : public LayerSupportBase { |
| 39 | public: |
| 40 | bool IsInputSupported(const TensorInfo& input, |
| 41 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override |
| 42 | { |
| 43 | return true; |
| 44 | } |
| 45 | |
| 46 | bool IsOutputSupported(const TensorInfo& input, |
| 47 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override |
| 48 | { |
| 49 | return true; |
| 50 | } |
| 51 | |
| 52 | bool IsAdditionSupported(const TensorInfo& input0, |
| 53 | const TensorInfo& input1, |
| 54 | const TensorInfo& output, |
| 55 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override |
| 56 | { |
| 57 | return true; |
| 58 | } |
| 59 | |
| 60 | bool IsConvolution2dSupported(const TensorInfo& input, |
| 61 | const TensorInfo& output, |
| 62 | const Convolution2dDescriptor& descriptor, |
| 63 | const TensorInfo& weights, |
| 64 | const Optional<TensorInfo>& biases, |
| 65 | Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override |
| 66 | { |
| 67 | return true; |
| 68 | } |
| 69 | }; |
| 70 | |
Matteo Martincigh | 88054f8 | 2019-05-17 12:15:30 +0100 | [diff] [blame] | 71 | } // namespace armnn |