ArmNN
 25.11
Loading...
Searching...
No Matches
ClBackendModelContext.hpp
Go to the documentation of this file.
1//
2// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5#pragma once
6
8
9#include<string>
10
11namespace armnn
12{
13
14/// The ClBackendModelContext is used to pass in CL specific backend ModelOptions. The supported backend ModelOptions
15/// are:
16/// - "FastMathEnabled"\n
17/// Using the fast_math flag can lead to performance improvements in fp32 and fp16 layers but may result in\n
18/// results with reduced or different precision. The fast_math flag will not have any effect on int8 performance.
19/// - "SaveCachedNetwork"\n
20/// Using the save_cached_network flag enables saving the cached network\n
21/// to a file given with the cached_network_file_path option.
22/// - "CachedNetworkFilePath"\n
23/// If the cached_network_file_path is a valid file and the save_cached_network flag is present\n
24/// then the cached network will be saved to the given file.\n
25/// If the cached_network_file_path is a valid file and the save_cached_network flag is not present\n
26/// then the cached network will be loaded from the given file.\n
27/// This will remove the time taken for initial compilation of kernels and speed up the first execution.
29{
30public:
31 ClBackendModelContext(const ModelOptions& modelOptions);
32
33 std::string GetCachedNetworkFilePath() const;
34
35 bool IsFastMathEnabled() const;
36
37 bool SaveCachedNetwork() const;
38
39 int GetCachedFileDescriptor() const;
40
41private:
42 std::string m_CachedNetworkFilePath;
43 bool m_IsFastMathEnabled;
44 bool m_SaveCachedNetwork;
45 int m_CachedFileDescriptor;
46
47};
48
49} // namespace armnn
ClBackendModelContext(const ModelOptions &modelOptions)
std::string GetCachedNetworkFilePath() const
Copyright (c) 2021 ARM Limited and Contributors.
std::vector< BackendOptions > ModelOptions