• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
28     // After Enqueue workload events
29     virtual bool AfterEnqueueWorkload(NetworkId networkId) = 0;
30 
~IBackendContext()31     virtual ~IBackendContext() {}
32 };
33 
34 using IBackendContextUniquePtr = std::unique_ptr<IBackendContext>;
35 
36 class IBackendModelContext
37 {
38 public:
~IBackendModelContext()39     virtual ~IBackendModelContext() {}
40 };
41 
42 } // namespace armnn