David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | #pragma once |
| 6 | |
David Beck | 9efb57d | 2018-11-05 13:40:33 +0000 | [diff] [blame] | 7 | #include <armnn/Types.hpp> |
David Beck | 1b61be5 | 2018-11-08 09:19:14 +0000 | [diff] [blame] | 8 | #include <armnn/IRuntime.hpp> |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 9 | |
| 10 | namespace armnn |
| 11 | { |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 12 | class IWorkloadFactory; |
David Beck | 1b61be5 | 2018-11-08 09:19:14 +0000 | [diff] [blame] | 13 | class IBackendContext; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 14 | |
| 15 | class IBackendInternal : public IBackend |
| 16 | { |
| 17 | protected: |
David Beck | 9efb57d | 2018-11-05 13:40:33 +0000 | [diff] [blame] | 18 | // Creation must be done through a specific |
| 19 | // backend interface. |
David Beck | 6b779f0 | 2018-10-09 17:20:21 +0100 | [diff] [blame] | 20 | IBackendInternal() = default; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 21 | |
| 22 | public: |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 23 | // Allow backends created by the factory function |
| 24 | // to be destroyed through IBackendInternal. |
| 25 | ~IBackendInternal() override = default; |
| 26 | |
| 27 | using IWorkloadFactoryPtr = std::unique_ptr<IWorkloadFactory>; |
David Beck | 1b61be5 | 2018-11-08 09:19:14 +0000 | [diff] [blame] | 28 | using IBackendContextPtr = std::unique_ptr<IBackendContext>; |
| 29 | |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 30 | virtual IWorkloadFactoryPtr CreateWorkloadFactory() const = 0; |
David Beck | 1b61be5 | 2018-11-08 09:19:14 +0000 | [diff] [blame] | 31 | virtual IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const = 0; |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 32 | }; |
| 33 | |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 34 | using IBackendInternalUniquePtr = std::unique_ptr<IBackendInternal>; |
| 35 | |
David Beck | e97c6e0 | 2018-10-03 13:09:28 +0100 | [diff] [blame] | 36 | } // namespace armnn |