ArmNN
 24.08
BackendSettings Struct Reference

#include <BackendSettings.hpp>

Public Member Functions

 BackendSettings ()=default
 
 BackendSettings (const BackendIdVector &preferredBackends, const IDeviceSpec &deviceSpec)
 
 BackendSettings (const BackendSettings &other)
 
bool IsBackendPreferred (const BackendId &backend) const
 
bool IsBackendSupported (const BackendId &backend) const
 
bool IsBackendSelected (const BackendId &backend) const
 
bool IsBackendIgnored (const BackendId &backend) const
 
bool IsCpuRefUsed () const
 
BackendIdVector GetAvailablePreferredBackends () const
 

Public Attributes

BackendIdVector m_PreferredBackends
 
BackendIdSet m_SupportedBackends
 
BackendIdSet m_SelectedBackends
 
BackendIdSet m_IgnoredBackends
 

Detailed Description

Definition at line 18 of file BackendSettings.hpp.

Constructor & Destructor Documentation

◆ BackendSettings() [1/3]

BackendSettings ( )
default

◆ BackendSettings() [2/3]

BackendSettings ( const BackendIdVector preferredBackends,
const IDeviceSpec deviceSpec 
)
inline

Definition at line 27 of file BackendSettings.hpp.

29  {
30  Initialize(preferredBackends, deviceSpec);
31  }

◆ BackendSettings() [3/3]

BackendSettings ( const BackendSettings other)
inline

Definition at line 33 of file BackendSettings.hpp.

34  : m_PreferredBackends(other.m_PreferredBackends)
35  , m_SupportedBackends(other.m_SupportedBackends)
36  , m_SelectedBackends(other.m_SelectedBackends)
37  , m_IgnoredBackends(other.m_IgnoredBackends)
38  {
39  }

Member Function Documentation

◆ GetAvailablePreferredBackends()

BackendIdVector GetAvailablePreferredBackends ( ) const
inline

Definition at line 67 of file BackendSettings.hpp.

68  {
69  BackendIdVector availablePreferredBackends;
70  for (const BackendId& backend : m_PreferredBackends)
71  {
72  if (IsBackendSupported(backend) && !IsBackendIgnored(backend))
73  {
74  availablePreferredBackends.push_back(backend);
75  }
76  }
77  return availablePreferredBackends;
78  }

References BackendSettings::IsBackendIgnored(), BackendSettings::IsBackendSupported(), and BackendSettings::m_PreferredBackends.

Referenced by armnn::AssignBackends(), and armnn::Optimize().

◆ IsBackendIgnored()

bool IsBackendIgnored ( const BackendId backend) const
inline

Definition at line 56 of file BackendSettings.hpp.

57  {
58  return IsBackendInCollection(backend, m_IgnoredBackends);
59  }

References BackendSettings::m_IgnoredBackends.

Referenced by BackendSettings::GetAvailablePreferredBackends().

◆ IsBackendPreferred()

bool IsBackendPreferred ( const BackendId backend) const
inline

Definition at line 41 of file BackendSettings.hpp.

42  {
43  return IsBackendInCollection(backend, m_PreferredBackends);
44  }

References BackendSettings::m_PreferredBackends.

Referenced by BackendSettings::IsCpuRefUsed().

◆ IsBackendSelected()

bool IsBackendSelected ( const BackendId backend) const
inline

Definition at line 51 of file BackendSettings.hpp.

52  {
53  return IsBackendInCollection(backend, m_SelectedBackends);
54  }

References BackendSettings::m_SelectedBackends.

◆ IsBackendSupported()

bool IsBackendSupported ( const BackendId backend) const
inline

Definition at line 46 of file BackendSettings.hpp.

47  {
48  return IsBackendInCollection(backend, m_SupportedBackends);
49  }

References BackendSettings::m_SupportedBackends.

Referenced by armnn::AssignBackendsIConnectable(), BackendSettings::GetAvailablePreferredBackends(), and BackendSettings::IsCpuRefUsed().

◆ IsCpuRefUsed()

bool IsCpuRefUsed ( ) const
inline

Definition at line 61 of file BackendSettings.hpp.

62  {
63  BackendId cpuBackendId(Compute::CpuRef);
64  return IsBackendSupported(cpuBackendId) && IsBackendPreferred(cpuBackendId);
65  }

References armnn::CpuRef, BackendSettings::IsBackendPreferred(), and BackendSettings::IsBackendSupported().

Referenced by armnn::AssignBackendsIConnectable().

Member Data Documentation

◆ m_IgnoredBackends

BackendIdSet m_IgnoredBackends

◆ m_PreferredBackends

◆ m_SelectedBackends

◆ m_SupportedBackends


The documentation for this struct was generated from the following file:
armnn::BackendSettings::m_IgnoredBackends
BackendIdSet m_IgnoredBackends
Definition: BackendSettings.hpp:23
armnn::Compute::CpuRef
@ CpuRef
CPU Execution: Reference C++ kernels.
armnn::BackendSettings::m_SelectedBackends
BackendIdSet m_SelectedBackends
Definition: BackendSettings.hpp:22
armnn::BackendSettings::IsBackendIgnored
bool IsBackendIgnored(const BackendId &backend) const
Definition: BackendSettings.hpp:56
armnn::BackendSettings::m_SupportedBackends
BackendIdSet m_SupportedBackends
Definition: BackendSettings.hpp:21
armnn::BackendIdVector
std::vector< BackendId > BackendIdVector
Definition: BackendId.hpp:192
armnn::BackendSettings::IsBackendSupported
bool IsBackendSupported(const BackendId &backend) const
Definition: BackendSettings.hpp:46
armnn::BackendSettings::m_PreferredBackends
BackendIdVector m_PreferredBackends
Definition: BackendSettings.hpp:20
armnn::BackendSettings::IsBackendPreferred
bool IsBackendPreferred(const BackendId &backend) const
Definition: BackendSettings.hpp:41