blob: 9d649fcfe2b16a7af3e388730d9a70b7a431f312 [file] [log] [blame]
David Becke97c6e02018-10-03 13:09:28 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5#pragma once
6
David Beck9efb57d2018-11-05 13:40:33 +00007#include <armnn/Types.hpp>
David Beck1b61be52018-11-08 09:19:14 +00008#include <armnn/IRuntime.hpp>
David Beck263e3492018-11-09 14:46:40 +00009#include <vector>
David Becke97c6e02018-10-03 13:09:28 +010010
11namespace armnn
12{
David Beck29c75de2018-10-23 13:35:58 +010013class IWorkloadFactory;
David Beck1b61be52018-11-08 09:19:14 +000014class IBackendContext;
David Beck263e3492018-11-09 14:46:40 +000015class Optimization;
David Beck111b5d92018-11-12 14:59:37 +000016class ILayerSupport;
David Becke97c6e02018-10-03 13:09:28 +010017
18class IBackendInternal : public IBackend
19{
20protected:
David Beck9efb57d2018-11-05 13:40:33 +000021 // Creation must be done through a specific
22 // backend interface.
David Beck6b779f02018-10-09 17:20:21 +010023 IBackendInternal() = default;
David Becke97c6e02018-10-03 13:09:28 +010024
25public:
David Beck29c75de2018-10-23 13:35:58 +010026 // Allow backends created by the factory function
27 // to be destroyed through IBackendInternal.
28 ~IBackendInternal() override = default;
29
30 using IWorkloadFactoryPtr = std::unique_ptr<IWorkloadFactory>;
David Beck1b61be52018-11-08 09:19:14 +000031 using IBackendContextPtr = std::unique_ptr<IBackendContext>;
David Beck263e3492018-11-09 14:46:40 +000032 using OptimizationPtr = std::unique_ptr<Optimization>;
33 using Optimizations = std::vector<OptimizationPtr>;
David Beck111b5d92018-11-12 14:59:37 +000034 using ILayerSupportSharedPtr = std::shared_ptr<ILayerSupport>;
David Beck1b61be52018-11-08 09:19:14 +000035
David Beck29c75de2018-10-23 13:35:58 +010036 virtual IWorkloadFactoryPtr CreateWorkloadFactory() const = 0;
David Beck1b61be52018-11-08 09:19:14 +000037 virtual IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const = 0;
David Beck263e3492018-11-09 14:46:40 +000038 virtual Optimizations GetOptimizations() const = 0;
David Beck111b5d92018-11-12 14:59:37 +000039 virtual ILayerSupportSharedPtr GetLayerSupport() const = 0;
David Becke97c6e02018-10-03 13:09:28 +010040};
41
David Beck29c75de2018-10-23 13:35:58 +010042using IBackendInternalUniquePtr = std::unique_ptr<IBackendInternal>;
43
David Becke97c6e02018-10-03 13:09:28 +010044} // namespace armnn