Type

#include <poplar/Type.hpp>

Defines

POPLAR_DECLARE_EQUIV_TYPE(T1, T2)
template<>
struct std::hash<poplar::Type>

Public Functions

inline size_t operator()(const poplar::Type &t) const
namespace poplar

Poplar classes and functions.

A VectorList is a list of vectors with a specific layout and with the usage semantics of a 2D vector.

A 1D vector must be laid out in a contiguous memory region. A 2D vector is a vector of 1D vectors. Each of these 1D vectors that make up a 2D vector is called a “sub-vector” for the remainder of this document. The elements of a 2D vector can be accessed by indexing the 2D vector along the outer and inner dimensions as A[outer][inner].

The following two categories of layouts are supported:

  1. VectorListLayout::DELTANELEMENTS is a memory efficient 2D vector layout. For legacy systems VectorListLayout::DELTAN served a similar purpose. Each sub-vector must be laid out as a contiguous memory region but the sub-vectors may may not be laid out contiguous with respect to each other in memory. Each sub-vector may have a different length.

  2. VectorListLayout::ONE_PTR and other VectorListLayout layouts that are prefixed by SCALED_PTR are for Poplar runtime use only.

Functions

inline std::ostream &operator<<(std::ostream &os, const Type &t)

Variables

Type BOOL

Device type: bool

Type CHAR

Device type: char

Type UNSIGNED_CHAR

Device type: unsigned char

Type SIGNED_CHAR

Device type: signed char

Type UNSIGNED_SHORT

Device type: unsigned short

Type SHORT

Device type: short

Type UNSIGNED_INT

Device type: unsigned int

Type INT

Device type: int

Type UNSIGNED_LONG

Device type: unsigned long

Type LONG

Device type: long

Type UNSIGNED_LONGLONG

Device type: unsigned long long

Type LONGLONG

Device type: long long

Type QUARTER
Type QUARTER_METADATA
Type HALF

Device type: half

Type FLOAT

Device type: float

template<typename T>
struct equivalent_device_type
#include <Type.hpp>

Template structure to relate a host type to a device type.

This structure is specialized to allow a program to relate a host type to a corresponding device type. For example::

poplar::Type t = equivalent_device_type<int>().value;

class Type
#include <Type.hpp>

Class representing device data types.

These are used to define types for Poplar variables and tensors using Graph::addVariable() and constants using Graph::addConstant(). Poplar variables and constants may be connected to edges of Poplar vertices using Graph::addVertex() and Graph::connect(). All fields of a vertex must be one of the supported device data types. See Graph::connect() and the VertexRef class to connect vertex fields.

The following types are not supported:

  • LONG

  • UNSIGNED_LONG

  • DOUBLE

For supported types, the sizes on the IPU are:

  • BOOL: 1 byte

  • CHAR: 1 byte (signed)

  • SIGNED_CHAR: 1 byte

  • UNSIGNED_CHAR: 1 byte

  • SHORT: 2 bytes

  • SIGNED_SHORT: 2 bytes

  • UNSIGNED_SHORT: 2 bytes

  • INT: 4 bytes

  • SIGNED_INT: 4 bytes

  • SIGNED: 4 bytes

  • UNSIGNED_INT: 4 bytes

  • UNSIGNED: 4 bytes

  • LONGLONG: 8 bytes

  • UNSIGNED_LONGLONG: 8 bytes

  • HALF: 2 bytes

  • FLOAT: 4 bytes

Public Functions

Type()
~Type()
Type(const Type &other)
Type(Type &&other) noexcept
Type &operator=(const Type &other)
Type &operator=(Type &&other) noexcept
StringRef toString() const

Get a string representation on a type.

Returns

A string representation of the type.

bool operator==(const Type &other) const
inline bool operator!=(const Type &other) const
bool operator<(const Type &other) const
Type(SSOPointer<core::Type>)
const core::Type &getImpl() const
std::size_t hash() const
bool isFloatingPoint() const
bool requiresMetadata() const

Private Members

SSOPointer<core::Type> impl
namespace core
namespace std
template<> Type >

Public Functions

inline size_t operator()(const poplar::Type &t) const