21.05
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
7
#include <
armnn/backends/IBackendContext.hpp
>
8
9
#include<string>
10
11
namespace
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.
28
class
ClBackendModelContext
:
public
IBackendModelContext
29
{
30
public
:
31
ClBackendModelContext
(
const
ModelOptions
& modelOptions);
32
33
std::string
GetCachedNetworkFilePath
()
const
;
34
35
bool
IsFastMathEnabled
()
const
;
36
37
bool
SaveCachedNetwork
()
const
;
38
39
private
:
40
std::string m_CachedNetworkFilePath;
41
bool
m_IsFastMathEnabled;
42
bool
m_SaveCachedNetwork;
43
44
};
45
46
}
// namespace armnn
IBackendContext.hpp
armnn::ModelOptions
std::vector< BackendOptions > ModelOptions
Definition:
BackendOptions.hpp:17
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition:
01_00_software_tools.dox:6
armnn::ClBackendModelContext::SaveCachedNetwork
bool SaveCachedNetwork() const
Definition:
ClBackendModelContext.cpp:67
armnn::ClBackendModelContext::IsFastMathEnabled
bool IsFastMathEnabled() const
Definition:
ClBackendModelContext.cpp:62
armnn::IBackendModelContext
Definition:
IBackendContext.hpp:33
armnn::ClBackendModelContext::ClBackendModelContext
ClBackendModelContext(const ModelOptions &modelOptions)
Definition:
ClBackendModelContext.cpp:34
armnn::ClBackendModelContext
The ClBackendModelContext is used to pass in CL specific backend ModelOptions.
Definition:
ClBackendModelContext.hpp:28
armnn::ClBackendModelContext::GetCachedNetworkFilePath
std::string GetCachedNetworkFilePath() const
Definition:
ClBackendModelContext.cpp:57
src
backends
cl
ClBackendModelContext.hpp
Generated on Mon May 10 2021 16:39:47 for ArmNN by
1.8.13