26 Initialize(preferredBackends, deviceSpec);
30 : m_PreferredBackends(other.m_PreferredBackends)
31 , m_SupportedBackends(other.m_SupportedBackends)
32 , m_SelectedBackends(other.m_SelectedBackends)
33 , m_IgnoredBackends(other.m_IgnoredBackends)
39 return IsBackendInCollection(backend, m_PreferredBackends);
44 return IsBackendInCollection(backend, m_SupportedBackends);
49 return IsBackendInCollection(backend, m_SelectedBackends);
54 return IsBackendInCollection(backend, m_IgnoredBackends);
66 for (
const BackendId& backend : m_PreferredBackends)
70 availablePreferredBackends.push_back(backend);
73 return availablePreferredBackends;
81 m_PreferredBackends = preferredBackends;
84 const DeviceSpec& spec = *boost::polymorphic_downcast<const DeviceSpec*>(&deviceSpec);
88 template<
typename Collection>
89 bool IsBackendInCollection(
const BackendId& backend,
const Collection& collection)
const 91 return std::find(collection.begin(), collection.end(), backend) != collection.end();
BackendIdSet m_SupportedBackends
bool IsCpuRefUsed() const
BackendSettings(const BackendSettings &other)
BackendIdSet m_SelectedBackends
bool IsBackendSupported(const BackendId &backend) const
virtual const BackendIdSet & GetSupportedBackends() const override
BackendSettings(const BackendIdVector &preferredBackends, const IDeviceSpec &deviceSpec)
bool IsBackendPreferred(const BackendId &backend) const
bool IsBackendIgnored(const BackendId &backend) const
BackendSettings()=default
bool IsBackendSelected(const BackendId &backend) const
CPU Execution: Reference C++ kernels.
std::vector< BackendId > BackendIdVector
std::unordered_set< BackendId > BackendIdSet
BackendIdVector m_PreferredBackends
BackendIdVector GetAvailablePreferredBackends() const
Device specific knowledge to be passed to the optimizer.
BackendIdSet m_IgnoredBackends