ArmNN
 20.11
ClBackendModelContext Class Reference

The ClBackendModelContext is used to pass in CL specific backend ModelOptions. More...

#include <ClBackendModelContext.hpp>

Inheritance diagram for ClBackendModelContext:
IBackendModelContext

Public Member Functions

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

Detailed Description

The ClBackendModelContext is used to pass in CL 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 ClBackendModelContext.hpp.

Constructor & Destructor Documentation

◆ ClBackendModelContext()

ClBackendModelContext ( const ModelOptions modelOptions)

Definition at line 25 of file ClBackendModelContext.cpp.

References armnn::ParseOptions().

26  : m_IsFastMathEnabled(false)
27 {
28  if (!modelOptions.empty())
29  {
30  ParseOptions(modelOptions, "GpuAcc", [&](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 ClBackendModelContext.cpp.

Referenced by ClWorkloadFactory::CreateConvolution2d(), ClLayerSupport::IsConvolution2dSupported(), and ClBackend::OptimizeSubgraphView().

41 {
42  return m_IsFastMathEnabled;
43 }

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