ArmNN
 20.11
NeonBackendModelContext Class Reference

The NeonBackendModelContext is used to pass in Neon specific backend ModelOptions. More...

#include <NeonBackendModelContext.hpp>

Inheritance diagram for NeonBackendModelContext:
IBackendModelContext

Public Member Functions

 NeonBackendModelContext (const ModelOptions &modelOptions)
 
bool IsFastMathEnabled () const
 
- Public Member Functions inherited from IBackendModelContext
virtual ~IBackendModelContext ()
 

Detailed Description

The NeonBackendModelContext is used to pass in Neon specific backend ModelOptions.

The supported backend ModelOptions are:

  • "FastMathEnabled"
    Using the fast_math flag can lead to performance improvements in fp32 and fp16 layers but may result in
    results with reduced or different precision. The fast_math flag will not have any effect on int8 performance.

Definition at line 17 of file NeonBackendModelContext.hpp.

Constructor & Destructor Documentation

◆ NeonBackendModelContext()

NeonBackendModelContext ( const ModelOptions modelOptions)

Definition at line 25 of file NeonBackendModelContext.cpp.

References armnn::ParseOptions().

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 }
void ParseOptions(const std::vector< BackendOptions > &options, BackendId backend, F f)

Member Function Documentation

◆ IsFastMathEnabled()

bool IsFastMathEnabled ( ) const

Definition at line 40 of file NeonBackendModelContext.cpp.

Referenced by NeonWorkloadFactory::CreateConvolution2d(), and NeonLayerSupport::IsConvolution2dSupported().

41 {
42  return m_IsFastMathEnabled;
43 }

The documentation for this class was generated from the following files: