blob: 9c54b821e74b6b811d9020d581c4b06067453fc8 [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 Becke97c6e02018-10-03 13:09:28 +010016
17class IBackendInternal : public IBackend
18{
19protected:
David Beck9efb57d2018-11-05 13:40:33 +000020 // Creation must be done through a specific
21 // backend interface.
David Beck6b779f02018-10-09 17:20:21 +010022 IBackendInternal() = default;
David Becke97c6e02018-10-03 13:09:28 +010023
24public:
David Beck29c75de2018-10-23 13:35:58 +010025 // Allow backends created by the factory function
26 // to be destroyed through IBackendInternal.
27 ~IBackendInternal() override = default;
28
29 using IWorkloadFactoryPtr = std::unique_ptr<IWorkloadFactory>;
David Beck1b61be52018-11-08 09:19:14 +000030 using IBackendContextPtr = std::unique_ptr<IBackendContext>;
David Beck263e3492018-11-09 14:46:40 +000031 using OptimizationPtr = std::unique_ptr<Optimization>;
32 using Optimizations = std::vector<OptimizationPtr>;
David Beck1b61be52018-11-08 09:19:14 +000033
David Beck29c75de2018-10-23 13:35:58 +010034 virtual IWorkloadFactoryPtr CreateWorkloadFactory() const = 0;
David Beck1b61be52018-11-08 09:19:14 +000035 virtual IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const = 0;
David Beck263e3492018-11-09 14:46:40 +000036 virtual Optimizations GetOptimizations() const = 0;
David Becke97c6e02018-10-03 13:09:28 +010037};
38
David Beck29c75de2018-10-23 13:35:58 +010039using IBackendInternalUniquePtr = std::unique_ptr<IBackendInternal>;
40
David Becke97c6e02018-10-03 13:09:28 +010041} // namespace armnn