ArmNN
 24.02
NeonBackendModelContext Class Reference

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

#include <NeonBackendModelContext.hpp>

Inheritance diagram for NeonBackendModelContext:
[legend]
Collaboration diagram for NeonBackendModelContext:
[legend]

Public Member Functions

 NeonBackendModelContext (const ModelOptions &modelOptions)
 
bool IsFastMathEnabled () const
 
unsigned int GetNumberOfThreads () 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.
  • "NumberOfThreads"
    Specify the number of threads used by the CpuAcc backend.

Definition at line 19 of file NeonBackendModelContext.hpp.

Constructor & Destructor Documentation

◆ NeonBackendModelContext()

NeonBackendModelContext ( const ModelOptions modelOptions)

Definition at line 34 of file NeonBackendModelContext.cpp.

35  : m_IsFastMathEnabled(false), m_NumberOfThreads(0)
36 {
37  if (!modelOptions.empty())
38  {
39  ParseOptions(modelOptions, "CpuAcc", [&](std::string name, const BackendOptions::Var& value)
40  {
41  if (name == "FastMathEnabled")
42  {
43  m_IsFastMathEnabled |= ParseBool(value, false);
44  }
45  if (name == "NumberOfThreads")
46  {
47  m_NumberOfThreads |= ParseUnsignedInt(value, 0);
48  }
49  });
50  }
51 }

References armnn::ParseOptions().

Member Function Documentation

◆ GetNumberOfThreads()

unsigned int GetNumberOfThreads ( ) const

Definition at line 58 of file NeonBackendModelContext.cpp.

59 {
60  return m_NumberOfThreads;
61 }

◆ IsFastMathEnabled()

bool IsFastMathEnabled ( ) const

The documentation for this class was generated from the following files:
armnn::ParseOptions
void ParseOptions(const std::vector< BackendOptions > &options, BackendId backend, F f)
Definition: BackendOptions.hpp:297