aboutsummaryrefslogtreecommitdiff
path: root/src/backends/cl/ClContextDeserializer.hpp
blob: e3a9b9deb4f08113896e2b5d18164f91405329a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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