6#include <poplar/Quarter.hpp>
7#include <poplar/SSOPointer.hpp>
8#include <poplar/StringRef.hpp>
49 Type &operator=(
Type &&other)
noexcept;
56 bool operator==(
const Type &other)
const;
57 bool operator!=(
const Type &other)
const {
return !(*
this == other); }
58 bool operator<(
const Type &other)
const;
61 Type(SSOPointer<core::Type>);
62 const core::Type &getImpl()
const;
64 std::size_t hash()
const;
66 bool isFloatingPoint()
const;
68 bool requiresMetadata()
const;
71 SSOPointer<core::Type> impl;
74inline std::ostream &
operator<<(std::ostream &os,
const Type &t) {
75 return os << t.toString();
176extern Type QUARTER_METADATA;
194#define POPLAR_DECLARE_EQUIV_TYPE(T1, T2) \
195 template <> struct equivalent_device_type<T1> { \
196 const Type &value = T2; \
199POPLAR_DECLARE_EQUIV_TYPE(
bool,
BOOL)
200POPLAR_DECLARE_EQUIV_TYPE(
char,
CHAR)
204POPLAR_DECLARE_EQUIV_TYPE(
signed short,
SHORT)
206POPLAR_DECLARE_EQUIV_TYPE(
signed int,
INT)
208POPLAR_DECLARE_EQUIV_TYPE(
signed long,
LONG)
210POPLAR_DECLARE_EQUIV_TYPE(
signed long long,
LONGLONG)
211POPLAR_DECLARE_EQUIV_TYPE(
float,
FLOAT)
214#undef POPLAR_DECLARE_EQUIV_TYPE
220template <>
struct hash<
poplar::Type> {
221 size_t operator()(
const poplar::Type &t)
const {
return t.hash(); }
Type
Padding types as per numpy.pad.
Definition: Pad.hpp:24
Class representing device data types.
Definition: Type.hpp:42
StringRef toString() const
Get a string representation on a type.
Poplar classes and functions.
Definition: ArrayRef.hpp:14
std::ostream & operator<<(std::ostream &os, const DebugNameAndId &dnai)
Display the path name of the DebugNameAndId.
Type UNSIGNED_SHORT
Device type: unsigned short
Type LONGLONG
Device type: long long
Type LONG
Device type: long
Type UNSIGNED_CHAR
Device type: unsigned char
Type SHORT
Device type: short
Type FLOAT
Device type: float
Type CHAR
Device type: char
Type BOOL
Device type: bool
Type SIGNED_CHAR
Device type: signed char
Type UNSIGNED_INT
Device type: unsigned int
Type HALF
Device type: half
Type UNSIGNED_LONGLONG
Device type: unsigned long long
Type UNSIGNED_LONG
Device type: unsigned long
Template structure to relate a host type to a device type.
Definition: Type.hpp:192