ArmNN
 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 
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 
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 
41 {
42  return m_IsFastMathEnabled;
43 }
44 
45 } // namespace armnn
Very basic type safe variant.
DataLayout::NCHW false
void ParseOptions(const std::vector< BackendOptions > &options, BackendId backend, F f)
std::vector< BackendOptions > ModelOptions
Copyright (c) 2020 ARM Limited.
NeonBackendModelContext(const ModelOptions &modelOptions)
bool AsBool() const
Value getters.
bool IsBool() const
Type getters.