blob: 0ef26b64d26539af509ee5ab5f93885b0e5d0c59 (
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 "ClBackendModelContext.hpp"
namespace
{
bool ParseBool(const armnn::BackendOptions::Var& value, bool defaultValue)
{
if (value.IsBool())
{
return value.AsBool();
}
return defaultValue;
}
} // namespace anonymous
namespace armnn
{
ClBackendModelContext::ClBackendModelContext(const ModelOptions& modelOptions)
: m_IsFastMathEnabled(false)
{
if (!modelOptions.empty())
{
ParseOptions(modelOptions, "GpuAcc", [&](std::string name, const BackendOptions::Var& value)
{
if (name == "FastMathEnabled")
{
m_IsFastMathEnabled |= ParseBool(value, false);
}
});
}
}
bool ClBackendModelContext::IsFastMathEnabled() const
{
return m_IsFastMathEnabled;
}
} // namespace armnn
|