20.11
NeonBackendModelContext.cpp
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
6
#include "
NeonBackendModelContext.hpp
"
7
8
namespace
9
{
10
11
bool
ParseBool(
const
armnn::BackendOptions::Var
& value,
bool
defaultValue)
12
{
13
if
(value.
IsBool
())
14
{
15
return
value.
AsBool
();
16
}
17
return
defaultValue;
18
}
19
20
}
// namespace anonymous
21
22
namespace
armnn
23
{
24
25
NeonBackendModelContext::NeonBackendModelContext
(
const
ModelOptions
& modelOptions)
26
: m_IsFastMathEnabled(
false
)
27
{
28
if
(!modelOptions.empty())
29
{
30
ParseOptions
(modelOptions,
"CpuAcc"
, [&](std::string name,
const
BackendOptions::Var
& value)
31
{
32
if
(name ==
"FastMathEnabled"
)
33
{
34
m_IsFastMathEnabled |= ParseBool(value,
false
);
35
}
36
});
37
}
38
}
39
40
bool
NeonBackendModelContext::IsFastMathEnabled
()
const
41
{
42
return
m_IsFastMathEnabled;
43
}
44
45
}
// namespace armnn
armnn::BackendOptions::Var
Very basic type safe variant.
Definition:
BackendOptions.hpp:35
false
DataLayout::NCHW false
Definition:
ClLayerTests.cpp:135
armnn::ParseOptions
void ParseOptions(const std::vector< BackendOptions > &options, BackendId backend, F f)
Definition:
BackendOptions.hpp:269
armnn::ModelOptions
std::vector< BackendOptions > ModelOptions
Definition:
BackendOptions.hpp:17
armnn::NeonBackendModelContext::IsFastMathEnabled
bool IsFastMathEnabled() const
Definition:
NeonBackendModelContext.cpp:40
armnn
Copyright (c) 2020 ARM Limited.
Definition:
00_introduction.dox:25
NeonBackendModelContext.hpp
armnn::NeonBackendModelContext::NeonBackendModelContext
NeonBackendModelContext(const ModelOptions &modelOptions)
Definition:
NeonBackendModelContext.cpp:25
armnn::BackendOptions::Var::AsBool
bool AsBool() const
Value getters.
Definition:
BackendOptions.hpp:114
armnn::BackendOptions::Var::IsBool
bool IsBool() const
Type getters.
Definition:
BackendOptions.hpp:108
src
backends
neon
NeonBackendModelContext.cpp
Generated on Wed Nov 25 2020 09:59:13 for ArmNN by
1.8.13