diff options
author | Matthew Sloyan <matthew.sloyan@arm.com> | 2021-01-07 13:28:47 +0000 |
---|---|---|
committer | Matthew Sloyan <matthew.sloyan@arm.com> | 2021-01-11 17:03:54 +0000 |
commit | 80fbcd5f4d7b362360963af1df0121aa6b561576 (patch) | |
tree | 64c8d2588e55aad2813f6b07e40f87ac3b8e8ce1 /src/backends/cl/ClContextDeserializer.hpp | |
parent | a20b3129aa1c450ccf867c7b63844e8391753730 (diff) | |
download | armnn-80fbcd5f4d7b362360963af1df0121aa6b561576.tar.gz |
IVGCVSW-5483 'Implement Loading and Saving to File'
* Implemented Serialization and Deserialization of CLContext.
* Fixed flatbuffers android-nn-driver dependency.
!android-nn-driver:4772
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Change-Id: If806f050535ffaa70922ba0f1ffe7bb10f902329
Diffstat (limited to 'src/backends/cl/ClContextDeserializer.hpp')
-rw-r--r-- | src/backends/cl/ClContextDeserializer.hpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/backends/cl/ClContextDeserializer.hpp b/src/backends/cl/ClContextDeserializer.hpp new file mode 100644 index 0000000000..e3a9b9deb4 --- /dev/null +++ b/src/backends/cl/ClContextDeserializer.hpp @@ -0,0 +1,41 @@ +// +// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include <arm_compute/core/CL/CLCompileContext.h> + +namespace armnn +{ + +class ClContextDeserializer +{ +public: + ClContextDeserializer() = default; + ~ClContextDeserializer() = default; + + /// Deserializes the CLCompileContext built-in programs from a binary file + /// @param [in] clCompileContext The CLCompileContext to be serialized + /// @param [in] context The CL Kernel context built-in program will be created from + /// @param [in] device The CL Kernel device built-in program will be created from + /// @param [in] filePath The serialized file + void Deserialize(arm_compute::CLCompileContext& clCompileContext, + cl::Context& context, + cl::Device& device, + const std::string& filePath); + + /// Deserializes the CLCompileContext built-in programs from binary file contents + /// @param [in] clCompileContext The CLCompileContext to be serialized + /// @param [in] context The CL Kernel context built-in program will be created from + /// @param [in] device The CL Kernel device built-in program will be created from + /// @param [in] filePath The serialized file + void DeserializeFromBinary(arm_compute::CLCompileContext& clCompileContext, + cl::Context& context, + cl::Device& device, + const std::vector<uint8_t>& binaryContent); + +}; + +} // namespace armnn
\ No newline at end of file |