blob: 2be71e5ded045c1e1a630c7039281da6316b0378 (
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
42
43
44
45
|
//
// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
#include "NeonBackendModelContext.hpp"
namespace
{
bool ParseBool(const armnn::BackendOptions::Var& value, bool defaultValue)
{
if (value.IsBool())
{
return value.AsBool();
}
return defaultValue;
}
} // namespace anonymous
namespace armnn
{
NeonBackendModelContext::NeonBackendModelContext(const ModelOptions& modelOptions)
: m_IsFastMathEnabled(false)
{
if (!modelOptions.empty())
{
ParseOptions(modelOptions, "CpuAcc", [&](std::string name, const BackendOptions::Var& value)
{
if (name == "FastMathEnabled")
{
m_IsFastMathEnabled |= ParseBool(value, false);
}
});
}
}
bool NeonBackendModelContext::IsFastMathEnabled() const
{
return m_IsFastMathEnabled;
}
} // namespace armnn
|