blob: fede3664753e0ca7266bd305f03d893486870ebe [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 Becke97c6e02018-10-03 13:09:28 +01009
10namespace armnn
11{
David Beck29c75de2018-10-23 13:35:58 +010012class IWorkloadFactory;
David Beck1b61be52018-11-08 09:19:14 +000013class IBackendContext;
David Becke97c6e02018-10-03 13:09:28 +010014
15class IBackendInternal : public IBackend
16{
17protected:
David Beck9efb57d2018-11-05 13:40:33 +000018 // Creation must be done through a specific
19 // backend interface.
David Beck6b779f02018-10-09 17:20:21 +010020 IBackendInternal() = default;
David Becke97c6e02018-10-03 13:09:28 +010021
22public:
David Beck29c75de2018-10-23 13:35:58 +010023 // 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 Beck1b61be52018-11-08 09:19:14 +000028 using IBackendContextPtr = std::unique_ptr<IBackendContext>;
29
David Beck29c75de2018-10-23 13:35:58 +010030 virtual IWorkloadFactoryPtr CreateWorkloadFactory() const = 0;
David Beck1b61be52018-11-08 09:19:14 +000031 virtual IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const = 0;
David Becke97c6e02018-10-03 13:09:28 +010032};
33
David Beck29c75de2018-10-23 13:35:58 +010034using IBackendInternalUniquePtr = std::unique_ptr<IBackendInternal>;
35
David Becke97c6e02018-10-03 13:09:28 +010036} // namespace armnn