1 // 2 // Copyright © 2017 Arm Ltd. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 // 5 #pragma once 6 7 #include <armnn/BackendOptions.hpp> 8 #include <armnn/IRuntime.hpp> 9 #include <memory> 10 11 namespace armnn 12 { 13 14 class IBackendContext 15 { 16 protected: IBackendContext(const IRuntime::CreationOptions &)17 IBackendContext(const IRuntime::CreationOptions&) {} 18 19 public: 20 /// Before and after Load network events 21 virtual bool BeforeLoadNetwork(NetworkId networkId) = 0; 22 virtual bool AfterLoadNetwork(NetworkId networkId) = 0; 23 24 /// Before and after Unload network events 25 virtual bool BeforeUnloadNetwork(NetworkId networkId) = 0; 26 virtual bool AfterUnloadNetwork(NetworkId networkId) = 0; 27 ~IBackendContext()28 virtual ~IBackendContext() {} 29 }; 30 31 using IBackendContextUniquePtr = std::unique_ptr<IBackendContext>; 32 33 class IBackendModelContext 34 { 35 public: ~IBackendModelContext()36 virtual ~IBackendModelContext() {} 37 }; 38 39 } // namespace armnn