IVGCVSW-5483 'Implement Loading and Saving to File'
[platform/upstream/armnn.git] / src / backends / cl / ClContextDeserializer.hpp
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5
6 #pragma once
7
8 #include <arm_compute/core/CL/CLCompileContext.h>
9
10 namespace armnn
11 {
12
13 class ClContextDeserializer
14 {
15 public:
16     ClContextDeserializer()  = default;
17     ~ClContextDeserializer() = default;
18
19     /// Deserializes the CLCompileContext built-in programs from a binary file
20     /// @param [in] clCompileContext The CLCompileContext to be serialized
21     /// @param [in] context The CL Kernel context built-in program will be created from
22     /// @param [in] device The CL Kernel device built-in program will be created from
23     /// @param [in] filePath The serialized file
24     void Deserialize(arm_compute::CLCompileContext& clCompileContext,
25                      cl::Context& context,
26                      cl::Device& device,
27                      const std::string& filePath);
28
29     /// Deserializes the CLCompileContext built-in programs from binary file contents
30     /// @param [in] clCompileContext The CLCompileContext to be serialized
31     /// @param [in] context The CL Kernel context built-in program will be created from
32     /// @param [in] device The CL Kernel device built-in program will be created from
33     /// @param [in] filePath The serialized file
34     void DeserializeFromBinary(arm_compute::CLCompileContext& clCompileContext,
35                                cl::Context& context,
36                                cl::Device& device,
37                                const std::vector<uint8_t>& binaryContent);
38
39 };
40
41 } // namespace armnn