11#include <unordered_set>
44 default:
return "Unknown";
50inline std::ostream&
operator<<(std::ostream& os,
const std::vector<Compute>& compute)
52 for (
const Compute& comp : compute)
61inline std::ostream&
operator<<(std::ostream& os,
const std::set<Compute>& compute)
63 for (
const Compute& comp : compute)
96 operator std::string()
const {
return m_Id; }
108 std::swap(temp.m_Id, m_Id);
114 return m_Id == other.m_Id;
119 template <
typename O>
123 return *
this == temp;
126 template <
typename O>
129 return !(*
this == other);
134 return m_Id < other.m_Id;
141 const std::string&
Get()
const {
return m_Id; }
163 std::hash<std::string> hasher;
164 return hasher(
id.Get());
176static const BackendId BACKEND_ID(
"ARMNN");
185template <
template <
typename...>
class TContainer,
typename... TContainerTemplateArgs>
190 for (
const auto&
id : ids) { os <<
id <<
" "; }
BackendId(const std::string &id)
bool operator<(const BackendId &other) const
BackendId(const char *id)
BackendId(BackendId &&other)=default
BackendId & operator=(const std::string &other)
BackendId & operator=(const BackendId &other)=default
BackendId(const BackendId &other)=default
BackendId & operator=(Compute compute)
Deprecated function that will be removed together with the Compute enum.
BackendId & operator=(BackendId &&other)=default
const std::string & Get() const
BackendId(Compute compute)
Deprecated function that will be removed together with the Compute enum.
bool operator==(const BackendId &other) const
bool operator==(const O &other) const
comparison against objects from which the BackendId can be constructed
bool operator!=(const O &other) const
Copyright (c) 2021 ARM Limited and Contributors.
std::unordered_set< BackendId > BackendIdSet
std::ostream & operator<<(std::ostream &os, const std::vector< Compute > &compute)
Deprecated function that will be removed together with the Compute enum.
constexpr char const * GetComputeDeviceAsCString(Compute compute)
Deprecated function that will be removed together with the Compute enum.
std::vector< BackendId > BackendIdVector
Compute
The Compute enum is now deprecated and it is now being replaced by BackendId.
@ CpuAcc
CPU Execution: NEON: ArmCompute.
@ CpuRef
CPU Execution: Reference C++ kernels.
@ TosaRef
CPU Execution: TOSA Reference Model.
@ GpuAcc
GPU Execution: OpenCL: ArmCompute.
mapbox::util::variant< std::vector< float >, std::vector< int >, std::vector< unsigned char >, std::vector< int8_t > > TContainer
std::size_t operator()(const armnn::BackendId &id) const noexcept