diff options
author | David Beck <david.beck@arm.com> | 2018-11-08 09:19:14 +0000 |
---|---|---|
committer | David Beck <david.beck@arm.com> | 2018-11-08 12:48:30 +0000 |
commit | 1b61be517387a20cd869e30587de2140b6d2252d (patch) | |
tree | 06ca37c640ccf4cd1fc5722393caf16c15a16b14 /src/backends/cl/ClBackendContext.hpp | |
parent | 60578950322491e44b4203fe085c3230ead19c7a (diff) | |
download | armnn-1b61be517387a20cd869e30587de2140b6d2252d.tar.gz |
IVGCVSW-2056+IVGCVSW-2064 : move ClContextControl to the ClBackendexperimental/nhwc-preview
* add IBackendContext interface
* add ClBackendContext implementation
Change-Id: I13e4d12b73d4c7775069587675276f7cee7d630b
Diffstat (limited to 'src/backends/cl/ClBackendContext.hpp')
-rw-r--r-- | src/backends/cl/ClBackendContext.hpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/backends/cl/ClBackendContext.hpp b/src/backends/cl/ClBackendContext.hpp new file mode 100644 index 0000000000..24497c2249 --- /dev/null +++ b/src/backends/cl/ClBackendContext.hpp @@ -0,0 +1,36 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// +#pragma once + +#include <backendsCommon/IBackendContext.hpp> +#include <unordered_set> +#include <mutex> + +namespace armnn +{ + +class ClBackendContext : public IBackendContext +{ +public: + ClBackendContext(const IRuntime::CreationOptions& options); + + bool BeforeLoadNetwork(NetworkId networkId) override; + bool AfterLoadNetwork(NetworkId networkId) override; + + bool BeforeUnloadNetwork(NetworkId networkId) override; + bool AfterUnloadNetwork(NetworkId networkId) override; + + ~ClBackendContext() override; + +private: + std::mutex m_Mutex; + struct ClContextControlWrapper; + std::unique_ptr<ClContextControlWrapper> m_ClContextControlWrapper; + + std::unordered_set<NetworkId> m_NetworkIds; + +}; + +} // namespace armnn
\ No newline at end of file |