ArmNN
 22.05.01
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  }
BackendIdSet m_IgnoredBackends
BackendIdSet m_SupportedBackends
BackendIdVector m_PreferredBackends
BackendIdSet m_SelectedBackends

Member Function Documentation

◆ GetAvailablePreferredBackends()

BackendIdVector GetAvailablePreferredBackends ( ) const
inline

Definition at line 67 of file BackendSettings.hpp.

References DeviceSpec::GetSupportedBackends(), BackendSettings::IsBackendIgnored(), and BackendSettings::IsBackendSupported().

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

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  }
std::vector< BackendId > BackendIdVector
Definition: BackendId.hpp:192
bool IsBackendSupported(const BackendId &backend) const
bool IsBackendIgnored(const BackendId &backend) const
BackendIdVector m_PreferredBackends

◆ IsBackendIgnored()

bool IsBackendIgnored ( const BackendId backend) const
inline

Definition at line 56 of file BackendSettings.hpp.

Referenced by BackendSettings::GetAvailablePreferredBackends().

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

◆ IsBackendPreferred()

bool IsBackendPreferred ( const BackendId backend) const
inline

Definition at line 41 of file BackendSettings.hpp.

Referenced by BackendSettings::IsCpuRefUsed().

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

◆ IsBackendSelected()

bool IsBackendSelected ( const BackendId backend) const
inline

Definition at line 51 of file BackendSettings.hpp.

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

◆ IsBackendSupported()

bool IsBackendSupported ( const BackendId backend) const
inline

Definition at line 46 of file BackendSettings.hpp.

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

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

◆ IsCpuRefUsed()

bool IsCpuRefUsed ( ) const
inline

Definition at line 61 of file BackendSettings.hpp.

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

Referenced by armnn::AssignBackendsIConnectable().

62  {
63  BackendId cpuBackendId(Compute::CpuRef);
64  return IsBackendSupported(cpuBackendId) && IsBackendPreferred(cpuBackendId);
65  }
CPU Execution: Reference C++ kernels.
bool IsBackendSupported(const BackendId &backend) const
bool IsBackendPreferred(const BackendId &backend) const

Member Data Documentation

◆ m_IgnoredBackends

BackendIdSet m_IgnoredBackends

Definition at line 23 of file BackendSettings.hpp.

◆ m_PreferredBackends

BackendIdVector m_PreferredBackends

Definition at line 20 of file BackendSettings.hpp.

Referenced by armnn::ReturnWithError().

◆ m_SelectedBackends

BackendIdSet m_SelectedBackends

◆ m_SupportedBackends

BackendIdSet m_SupportedBackends

Definition at line 21 of file BackendSettings.hpp.

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


The documentation for this struct was generated from the following file: