2. Poplar runtime API reference

The following types are used when writing vertex code (codelets) for the IPU.

Codelets can be compiled for both the IPU and to run on the CPU. (Running code on the CPU is occasionally useful for debugging or simple functional tests when IPU hardware is not available.) By using these include files, the correct definitions for either the IPU or the CPU will be used. You should not directly include other include files from the Poplar runtime.

2.1. Vertex types

#include <poplar/Vertex.hpp>

Defines

WORKER_ALIGN
namespace poplar

Poplar classes and functions.

Typedefs

using SupervisorVertexIf = std::conditional_t<pred, SupervisorVertex, Vertex>

Metafunction that returns a SupervisorVertex if pred is true otherwise a Vertex.

class ExternalExchangeVertex
#include <Vertex.hpp>

ExternalExchangeVertex base class; Any sub-type of this class needs to define a compute() method.

class SupervisorVertex
#include <Vertex.hpp>

SupervisorVertex base class; Any sub-type of this class needs to define a compute() method.

class Vertex
#include <Vertex.hpp>

Vertex base class.

Any sub-type of this class needs to define a compute() method.

2.2. Input & output types

#include <poplar/InOutTypes.hpp>

Defines

NO_INSTRUMENT
namespace poplar

Poplar classes and functions.

template<typename T>
class InOut : public poplar::InOutBase
#include <InOutTypes.hpp>

InOut.

Public Functions

NO_INSTRUMENT operator T&() const
NO_INSTRUMENT T & operator* () const
NO_INSTRUMENT T * operator-> () const
struct InOutBase

Subclassed by poplar::InOut< T >, poplar::Input< T >, poplar::Output< T >

Public Members

void *p
template<typename T>
class Input : public poplar::InOutBase
#include <InOutTypes.hpp>

Input.

Public Functions

NO_INSTRUMENT operator const T&() const
NO_INSTRUMENT const T & operator* () const
NO_INSTRUMENT const T * operator-> () const
template<typename T>
class Output : public poplar::InOutBase
#include <InOutTypes.hpp>

Output.

Public Functions

NO_INSTRUMENT operator T&() const
NO_INSTRUMENT T & operator* () const
NO_INSTRUMENT T * operator-> () const

2.3. Field types

#include <poplar/FieldTypes.hpp>
namespace poplar

Poplar classes and functions.

Enums

enum VectorLayout

The memory layout used for a Vector.

Values:

enumerator NOT_A_VECTOR
enumerator SPAN

A pointer to the start of the vector, and a count of the number of elements (not bytes) the vector contains.

This means the .size() member and iterators are available.

enumerator SHORT_SPAN

A pointer to the start of the vector and a count of the number of elements the vector contains.

The count is limited to 11 bits. The .size() member and iterators are available. Only addresses up to 1MB can be represented.

enumerator ONE_PTR

The same as SPAN but the count is not stored, so this is a single pointer to the start of the vector.

The vector does not know its size which must be learned by some other means. The .size() member and iterators are not available.

enumerator SCALED_PTR32

The same as ONE_PTR, but this uses a compressed 16-bit pointer containing bits 2-17 of the offset from the pointer to the base of memory.

Since the lower 2 bits are not stored it can only point to 32-bit aligned addresses (this is where the 32 in the name comes from).

enumerator SCALED_PTR64

The same as ONE_PTR, but this uses a compressed 16-bit pointer containing bits 3-18 of a full pointer.

Since the lower 3 bits are not stored it can only point to 64-bit aligned addresses (this is where the 64 in the name comes from). Addresses up to 512KB can be represented.

enumerator SCALED_PTR128

The same as ONE_PTR, but this uses a compressed 16-bit pointer containing bits 4-18 of a full pointer.

Since the lower 4 bits are not stored it can only point to 128-bit aligned addresses (this is where the 128 in the name comes from). Addresses up to 1MB can be represented.

enumerator COMPACT_PTR

This pointer type will resolve into the best suited, ideally space optimised, pointer given the therefore the size of the address space and the alignment.

For example on mk1: if the alignment is in the range [4,8) then this will become a SCALED_PTR32; if it is 8 or greater then it becomes a SCALED_PTR64. For all other alignments this pointer type is an uncompressed ONE_PTR.

enum VectorListLayout

Values:

enumerator NOT_A_VECTOR
enumerator ONE_PTR
enumerator SCALED_PTR32
enumerator SCALED_PTR64
enumerator SCALED_PTR128
enumerator DELTAN
enumerator DELTANELEMENTS
enumerator COMPACT_DELTAN

This type will resolve into the best suited, ideally space optimised, inner pointer type depending on the address space.

For example on mk1 it will be the same type of a DELTAN type as that can point to everything in the available memory.

2.4. Vector types

#include <poplar/VectorTypes.hpp>
template<typename T, unsigned MinAlign, bool Interleaved>
struct poplar::detail::VLayoutEnumToType<T, VectorLayout::SPAN, MinAlign, Interleaved>
#include <VectorTypes.hpp>

Vector.

Public Types

using type = SpanVectorBase<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved>
struct poplar::detail::VLayoutEnumToType<T, VectorLayout::SHORT_SPAN, MinAlign, Interleaved>

Public Types

using type = ShortSpanVectorBase<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved>
struct poplar::detail::VLayoutEnumToType<T, VectorLayout::ONE_PTR, MinAlign, Interleaved>

Public Types

using type = OnePtrVectorBase<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved>
struct poplar::detail::VLayoutEnumToType<T, VectorLayout::SCALED_PTR32, MinAlign, Interleaved>

Public Types

using type = ScaledPtr32VectorBase<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved>
struct poplar::detail::VLayoutEnumToType<T, VectorLayout::SCALED_PTR64, MinAlign, Interleaved>

Public Types

using type = ScaledPtr64VectorBase<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved>
struct poplar::detail::ImplicitVLayoutEnumToType<T, VectorLayout::SPAN, MinAlign, Interleaved>

Public Types

using type = SpanVectorBaseImplicitDeref<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved>
struct poplar::detail::ImplicitVLayoutEnumToType<T, VectorLayout::ONE_PTR, MinAlign, Interleaved>

Public Types

using type = OnePtrVectorBaseImplicitDeref<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved>
struct poplar::detail::ImplicitVLayoutEnumToType<T, VectorLayout::SCALED_PTR32, MinAlign, Interleaved>
template<typename T, unsigned MinAlign, bool Interleaved>
struct poplar::detail::ImplicitVLayoutEnumToType<T, VectorLayout::SCALED_PTR64, MinAlign, Interleaved>
namespace poplar

Poplar classes and functions.

template<class Base, unsigned MinAlign>
struct BaseWithAlign : public Base

Subclassed by poplar::OnePtrVectorBase< T, MinAlign >, poplar::ScaledPtr128VectorBase< T, MinAlign >, poplar::ScaledPtr32VectorBase< T, MinAlign >, poplar::ScaledPtr64VectorBase< T, MinAlign >, poplar::ShortSpanVectorBase< T, MinAlign >, poplar::SpanVectorBase< T, MinAlign >, poplar::ScaledPtr32VectorBase< DeltaN, 4 >

Public Functions

void *begin() const
template<typename T, VectorLayout L, unsigned MinAlign, bool Interleaved>
class InOut<Vector<T, L, MinAlign, Interleaved>> : public poplar::Vector<T, L, MinAlign, Interleaved>
#include <VectorTypes.hpp>

InOut<Vector>.

Public Functions

const Vector<T, L, MinAlign, Interleaved> &operator*() const
const Vector<T, L, MinAlign, Interleaved> *operator->() const
Vector<T, L, MinAlign, Interleaved> &operator*()
Vector<T, L, MinAlign, Interleaved> *operator->()
template<typename T, VectorLayout L, unsigned MinAlign, bool Interleaved>
class Input<Vector<T, L, MinAlign, Interleaved>> : public poplar::Vector<T, L, MinAlign, Interleaved>
#include <VectorTypes.hpp>

Input<Vector>.

Public Types

using iterator = typename Vector<std::enable_if<L == VectorLayout::SPAN, T>, VectorLayout::SPAN, MinAlign, Interleaved>::const_iterator

Public Functions

const Vector<T, L, MinAlign, Interleaved> &operator*() const
const Vector<T, L, MinAlign, Interleaved> *operator->() const
template<typename T, unsigned MinAlign>
class OnePtrVectorBase : public poplar::BaseWithAlign<PtrBase, MinAlign>

Public Types

typedef T *iterator
typedef const T *const_iterator

Public Functions

const_iterator begin() const
iterator begin()
const T &operator[](std::size_t index) const
T &operator[](std::size_t index)
template<typename T, unsigned MinAlign>
class OnePtrVectorBaseImplicitDeref : public poplar::PtrBase

Public Types

typedef DerefRandomAccessIterator<T, MinAlign> iterator
typedef DerefRandomAccessIterator<const T, MinAlign> const_iterator

Public Functions

const_iterator begin() const
iterator begin()
const T &operator[](std::size_t index) const
T &operator[](std::size_t index)
template<typename T, VectorLayout L, unsigned MinAlign, bool Interleaved>
class Output<Vector<T, L, MinAlign, Interleaved>> : public poplar::Vector<T, L, MinAlign, Interleaved>
#include <VectorTypes.hpp>

Output<Vector>.

Public Functions

const Vector<T, L, MinAlign, Interleaved> &operator*() const
const Vector<T, L, MinAlign, Interleaved> *operator->() const
Vector<T, L, MinAlign, Interleaved> &operator*()
Vector<T, L, MinAlign, Interleaved> *operator->()
struct PtrBase

Subclassed by poplar::BaseWithAlign< PtrBase, MinAlign >, poplar::OnePtrVectorBaseImplicitDeref< T, MinAlign >

Public Functions

void *begin() const

Public Members

void *ptr
struct ScaledBase128

Subclassed by poplar::BaseWithAlign< ScaledBase128, MinAlign >, poplar::ScaledPtr128VectorBaseImplicitDeref< T, MinAlign >

Public Functions

ScaledBase128() = default
void set(void *p)
ScaledBase128(void *p)
void *begin() const

Public Members

unsigned short pOffset
struct ScaledBase32

Subclassed by poplar::BaseWithAlign< ScaledBase32, MinAlign >, poplar::ScaledPtr32VectorBaseImplicitDeref< T, MinAlign >

Public Functions

ScaledBase32() = default
void set(void *p)
ScaledBase32(void *p)
void *begin() const

Public Members

unsigned short pOffset

Public Static Attributes

const uintptr_t memBase = 0x40000
struct ScaledBase64

Subclassed by poplar::BaseWithAlign< ScaledBase64, MinAlign >, poplar::ScaledPtr64VectorBaseImplicitDeref< T, MinAlign >

Public Functions

ScaledBase64() = default
void set(void *p)
ScaledBase64(void *p)
void *begin() const

Public Members

unsigned short pOffset
template<typename T, unsigned MinAlign>
class ScaledPtr128VectorBase : public poplar::BaseWithAlign<ScaledBase128, MinAlign>

Public Types

typedef T *iterator
typedef const T *const_iterator

Public Functions

const_iterator begin() const
iterator begin()
const T &operator[](std::size_t index) const
T &operator[](std::size_t index)
template<typename T, unsigned MinAlign>
class ScaledPtr128VectorBaseImplicitDeref : public poplar::ScaledBase128

Public Types

typedef DerefRandomAccessIterator<T, MinAlign> iterator
typedef DerefRandomAccessIterator<const T, MinAlign> const_iterator

Public Functions

const_iterator begin() const
iterator begin()
const T &operator[](std::size_t index) const
T &operator[](std::size_t index)
template<typename T, unsigned MinAlign>
class ScaledPtr32VectorBase : public poplar::BaseWithAlign<ScaledBase32, MinAlign>

Public Types

typedef T *iterator
typedef const T *const_iterator

Public Functions

const_iterator begin() const
iterator begin()
const T &operator[](std::size_t index) const
T &operator[](std::size_t index)
template<typename T, unsigned MinAlign>
class ScaledPtr32VectorBaseImplicitDeref : public poplar::ScaledBase32

Public Types

typedef DerefRandomAccessIterator<T, MinAlign> iterator
typedef DerefRandomAccessIterator<const T, MinAlign> const_iterator

Public Functions

const_iterator begin() const
iterator begin()
const T &operator[](std::size_t index) const
T &operator[](std::size_t index)
template<typename T, unsigned MinAlign>
class ScaledPtr64VectorBase : public poplar::BaseWithAlign<ScaledBase64, MinAlign>

Public Types

typedef T *iterator
typedef const T *const_iterator

Public Functions

const_iterator begin() const
iterator begin()
const T &operator[](std::size_t index) const
T &operator[](std::size_t index)
template<typename T, unsigned MinAlign>
class ScaledPtr64VectorBaseImplicitDeref : public poplar::ScaledBase64

Public Types

typedef DerefRandomAccessIterator<T, MinAlign> iterator
typedef DerefRandomAccessIterator<const T, MinAlign> const_iterator

Public Functions

const_iterator begin() const
iterator begin()
const T &operator[](std::size_t index) const
T &operator[](std::size_t index)
template<typename T, unsigned MinAlign>
class ShortSpanVectorBase : public poplar::BaseWithAlign<ShortVectorBase, MinAlign>

Public Types

typedef T *iterator
typedef const T *const_iterator

Public Functions

const_iterator begin() const
const_iterator end() const
iterator begin()
iterator end()
const T &operator[](std::size_t index) const
T &operator[](std::size_t index)
bool empty() const
template<typename T, unsigned MinAlign>
class ShortSpanVectorBaseImplicitDeref : public poplar::ShortVectorBase

Public Types

typedef DerefRandomAccessIterator<T, MinAlign> iterator
typedef DerefRandomAccessIterator<const T, MinAlign> const_iterator

Public Functions

const_iterator begin() const
const_iterator end() const
iterator begin()
iterator end()
const T &operator[](std::size_t index) const
T &operator[](std::size_t index)
bool empty() const
struct ShortVectorBase

Subclassed by poplar::BaseWithAlign< ShortVectorBase, MinAlign >, poplar::ShortSpanVectorBaseImplicitDeref< T, MinAlign >

Public Functions

void *begin() const
std::uint32_t size() const

Public Members

uint32_t address
uint32_t size_
template<typename T, unsigned MinAlign>
class SpanVectorBase : public poplar::BaseWithAlign<VectorBase, MinAlign>

Public Types

typedef T *iterator
typedef const T *const_iterator

Public Functions

const_iterator begin() const
const_iterator end() const
iterator begin()
iterator end()
const T &operator[](std::size_t index) const
T &operator[](std::size_t index)
bool empty() const
template<typename T, unsigned MinAlign>
class SpanVectorBaseImplicitDeref : public poplar::VectorBase

Public Types

typedef DerefRandomAccessIterator<T, MinAlign> iterator
typedef DerefRandomAccessIterator<const T, MinAlign> const_iterator

Public Functions

const_iterator begin() const
const_iterator end() const
iterator begin()
iterator end()
const T &operator[](std::size_t index) const
T &operator[](std::size_t index)
bool empty() const
template<typename T, VectorLayout L = VectorLayout::SPAN, unsigned MinAlign = detail::max(alignof(T), VectorLayoutTraits<L>::MinAlign), bool Interleaved = false>
struct Vector : public poplar::detail::VectorBase<T, L, MinAlign, Interleaved>

Subclassed by poplar::InOut< Vector< T, L, MinAlign, Interleaved > >, poplar::Input< Vector< T, L, MinAlign, Interleaved > >, poplar::Output< Vector< T, L, MinAlign, Interleaved > >

template<typename T, VectorLayout L, unsigned MinAlign, bool Interleaved>
class Vector<InOut<T>, L, MinAlign, Interleaved> : public poplar::detail::VectorBaseImplicitDeref<InOut<T>, L, MinAlign, Interleaved>
#include <VectorTypes.hpp>

Vector<InOut>.

template<typename T, VectorLayout L1, unsigned MinAlign1, bool Interleaved, VectorLayout L2, unsigned MinAlign2>
class Vector<InOut<Vector<T, L1, MinAlign1, Interleaved>>, L2, MinAlign2, false> : public poplar::detail::VectorBase<InOut<Vector<T, L1, MinAlign1, Interleaved>>, L2, MinAlign2, false>
#include <VectorTypes.hpp>

Vector<InOut<Vector<T>>.

template<typename T, VectorLayout L, unsigned MinAlign, bool Interleaved>
class Vector<Input<T>, L, MinAlign, Interleaved> : public poplar::detail::VectorBaseImplicitDeref<Input<T>, L, MinAlign, Interleaved>
#include <VectorTypes.hpp>

Vector<Input>.

template<typename T, VectorLayout L1, unsigned MinAlign1, bool Interleaved, VectorLayout L2, unsigned MinAlign2>
struct Vector<Input<Vector<T, L1, MinAlign1, Interleaved>>, L2, MinAlign2, false> : public poplar::detail::VectorBase<Input<Vector<T, L1, MinAlign1, Interleaved>>, L2, MinAlign2, false>
#include <VectorTypes.hpp>

Vector<Input<Vector<T>>.

template<typename T, VectorLayout L, unsigned MinAlign, bool Interleaved>
class Vector<Output<T>, L, MinAlign, Interleaved> : public poplar::detail::VectorBaseImplicitDeref<Output<T>, L, MinAlign, Interleaved>
#include <VectorTypes.hpp>

Vector<Output>.

template<typename T, VectorLayout L1, unsigned MinAlign1, bool Interleaved, VectorLayout L2, unsigned MinAlign2>
class Vector<Output<Vector<T, L1, MinAlign1, Interleaved>>, L2, MinAlign2, false> : public poplar::detail::VectorBase<Output<Vector<T, L1, MinAlign1, Interleaved>>, L2, MinAlign2, false>
#include <VectorTypes.hpp>

Vector<Output<Vector<T>>.

struct VectorBase

Subclassed by poplar::BaseWithAlign< VectorBase, MinAlign >, poplar::SpanVectorBaseImplicitDeref< T, MinAlign >

Public Functions

void *begin() const
std::uint32_t size() const

Public Members

void *beginPtr
std::uint32_t size_
namespace detail

Typedefs

using UnboxIO_t = typename UnboxIO<T>::type

Functions

constexpr VectorLayout resolveCompactPtr(const VectorLayout layout, const unsigned minAlign)
constexpr unsigned max(unsigned a, unsigned b)
template<typename T, VectorLayout L, unsigned MinAlign, bool Interleaved>
struct ImplicitVLayoutEnumToType
template<typename T, unsigned MinAlign, bool Interleaved> ONE_PTR, MinAlign, Interleaved >

Public Types

using type = OnePtrVectorBaseImplicitDeref<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved> SCALED_PTR32, MinAlign, Interleaved >

Public Types

using type = ScaledPtr32VectorBaseImplicitDeref<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved> SCALED_PTR64, MinAlign, Interleaved >

Public Types

using type = ScaledPtr64VectorBaseImplicitDeref<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved> SPAN, MinAlign, Interleaved >

Public Types

using type = SpanVectorBaseImplicitDeref<UnboxIO_t<T>, MinAlign>
template<typename T>
struct UnboxIO

Public Types

using type = T
template<typename T>
struct UnboxIO<InOut<T>>

Public Types

using type = T
template<typename T>
struct UnboxIO<Input<T>>

Public Types

using type = const T
template<typename T>
struct UnboxIO<Output<T>>

Public Types

using type = T
template<typename T, VectorLayout L, unsigned MinAlign, bool Interleaved>
struct VectorBase : public detail::VLayoutEnumToType::type<T, detail::resolveCompactPtr(L, MinAlign), MinAlign, Interleaved>

Subclassed by poplar::Vector< T, L, MinAlign, Interleaved >, poplar::Vector< InOut< Vector< T, L1, MinAlign1, Interleaved > >, L2, MinAlign2, false >, poplar::Vector< Input< Vector< T, L1, MinAlign1, Interleaved > >, L2, MinAlign2, false >, poplar::Vector< Output< Vector< T, L1, MinAlign1, Interleaved > >, L2, MinAlign2, false >

template<typename T, VectorLayout L, unsigned MinAlign, bool Interleaved>
struct VectorBaseImplicitDeref : public detail::ImplicitVLayoutEnumToType::type<T, detail::resolveCompactPtr(L, MinAlign), MinAlign, Interleaved>

Subclassed by poplar::Vector< InOut< T >, L, MinAlign, Interleaved >, poplar::Vector< Input< T >, L, MinAlign, Interleaved >, poplar::Vector< Output< T >, L, MinAlign, Interleaved >

template<typename T, VectorLayout L, unsigned MinAlign, bool Interleaved>
struct VLayoutEnumToType
template<typename T, unsigned MinAlign, bool Interleaved> ONE_PTR, MinAlign, Interleaved >

Public Types

using type = OnePtrVectorBase<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved> SCALED_PTR32, MinAlign, Interleaved >

Public Types

using type = ScaledPtr32VectorBase<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved> SCALED_PTR64, MinAlign, Interleaved >

Public Types

using type = ScaledPtr64VectorBase<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved> SHORT_SPAN, MinAlign, Interleaved >

Public Types

using type = ShortSpanVectorBase<UnboxIO_t<T>, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved> SPAN, MinAlign, Interleaved >
#include <VectorTypes.hpp>

Vector.

Public Types

using type = SpanVectorBase<UnboxIO_t<T>, MinAlign>

2.5. VectorList types

#include <poplar/VectorListTypes.hpp>
template<typename T, unsigned MinAlign, bool Interleaved>
struct poplar::detail::V2DLayoutEnumToType<T, VectorListLayout::DELTAN, MinAlign, Interleaved>

Public Types

using type = BaseAndDeltas<T, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved>
struct poplar::detail::V2DLayoutEnumToType<T, VectorListLayout::DELTANELEMENTS, MinAlign, Interleaved>

Public Types

using type = BaseAndDeltasElements<T, MinAlign>
namespace poplar

Poplar classes and functions.

template<typename T, unsigned MinAlign>
struct BaseAndDelta

Public Functions

void *begin() const
BaseAndDelta &operator++()
bool operator==(const BaseAndDelta &rhs) const
bool operator!=(const BaseAndDelta &rhs) const
size_t size() const
bool empty() const
T &operator[](std::size_t index)
const T &operator[](std::size_t index) const

Public Members

uintptr_t base
const DeltaN *p
template<typename T, unsigned MinAlign>
struct BaseAndDeltaElements

Public Functions

void *begin() const
BaseAndDeltaElements &operator++()
bool operator==(const BaseAndDeltaElements &rhs) const
bool operator!=(const BaseAndDeltaElements &rhs) const
size_t size() const
bool empty() const
T &operator[](std::size_t index)
const T &operator[](std::size_t index) const

Public Members

uintptr_t base
const DeltaNElements *p
struct BaseAndDeltaElementsBase

Subclassed by poplar::BaseAndDeltasElements< T, MinAlign >

Public Functions

BaseAndDeltaElementsBase() = delete
unsigned size() const
uintptr_t getBase() const
DeltaNElements *getDeltaN() const
template<typename T, unsigned MinAlign>
struct BaseAndDeltas : public poplar::BaseAndDeltasBase

Public Types

typedef BaseAndDelta<T, MinAlign> iterator

Public Functions

const iterator operator[](std::size_t index) const
iterator operator[](std::size_t index)
size_t size() const
bool empty() const
struct BaseAndDeltasBase

Subclassed by poplar::BaseAndDeltas< T, MinAlign >

Public Functions

BaseAndDeltasBase() = delete
uintptr_t getBase() const
ScaledPtr32VectorBase<DeltaN, 4> getDeltaN()
size_t getN() const

Public Members

uint16_t n
ScaledPtr32VectorBase<DeltaN, 4> deltaN
template<typename T, unsigned MinAlign>
struct BaseAndDeltasElements : public poplar::BaseAndDeltaElementsBase

Public Types

typedef BaseAndDeltaElements<T, MinAlign> iterator

Public Functions

const iterator operator[](std::size_t index) const
iterator operator[](std::size_t index)
size_t size() const
bool empty() const
struct DeltaN

Public Members

unsigned offset
unsigned n
struct DeltaNElements

Public Functions

unsigned getN(unsigned alignment) const
unsigned getOffset(unsigned alignment) const

Public Members

uint32_t packedBits

Public Static Functions

constexpr unsigned log2(unsigned n)
template<typename T, VectorListLayout L, unsigned MinAlign, bool Interleaved>
class InOut<VectorList<T, L, MinAlign, Interleaved>> : public poplar::VectorList<T, L, MinAlign, Interleaved>
#include <VectorListTypes.hpp>

InOut<VectorList>.

Public Functions

const VectorList<T, L, MinAlign, Interleaved> &operator*() const
const VectorList<T, L, MinAlign, Interleaved> *operator->() const
VectorList<T, L, MinAlign, Interleaved> &operator*()
VectorList<T, L, MinAlign, Interleaved> *operator->()
template<typename T, VectorListLayout L, unsigned MinAlign, bool Interleaved>
class Input<VectorList<T, L, MinAlign, Interleaved>> : public poplar::VectorList<T, L, MinAlign, Interleaved>
#include <VectorListTypes.hpp>

Input<VectorList>.

Public Functions

const VectorList<T, L, MinAlign, Interleaved> &operator*() const
const VectorList<T, L, MinAlign, Interleaved> *operator->() const
template<typename T, VectorListLayout L, unsigned MinAlign, bool Interleaved>
class Output<VectorList<T, L, MinAlign, Interleaved>> : public poplar::VectorList<T, L, MinAlign, Interleaved>
#include <VectorListTypes.hpp>

Output<VectorList>.

Public Functions

const VectorList<T, L, MinAlign, Interleaved> &operator*() const
const VectorList<T, L, MinAlign, Interleaved> *operator->() const
VectorList<T, L, MinAlign, Interleaved> &operator*()
VectorList<T, L, MinAlign, Interleaved> *operator->()
template<typename T, VectorListLayout L, unsigned MinAlign = detail::max(alignof(T), VectorListLayoutTraits<T, L>::MinAlign), bool Interleaved = false>
struct VectorList : public poplar::detail::VectorListBase<T, L, MinAlign, Interleaved>

Subclassed by poplar::InOut< VectorList< T, L, MinAlign, Interleaved > >, poplar::Input< VectorList< T, L, MinAlign, Interleaved > >, poplar::Output< VectorList< T, L, MinAlign, Interleaved > >

namespace detail

Functions

constexpr VectorListLayout resolveCompactDeltaN(const VectorListLayout layout)
template<typename T, VectorListLayout L, unsigned MinAlign, bool Interleaved>
struct V2DLayoutEnumToType
#include <VectorListTypes.hpp>

VectorList.

template<typename T, unsigned MinAlign, bool Interleaved> DELTAN, MinAlign, Interleaved >

Public Types

using type = BaseAndDeltas<T, MinAlign>
template<typename T, unsigned MinAlign, bool Interleaved> DELTANELEMENTS, MinAlign, Interleaved >

Public Types

using type = BaseAndDeltasElements<T, MinAlign>
template<typename T, VectorListLayout L, unsigned MinAlign, bool Interleaved>
struct VectorListBase : public V2DLayoutEnumToType::type<T, resolveCompactDeltaN(L), MinAlign, Interleaved>

Subclassed by poplar::VectorList< T, L, MinAlign, Interleaved >

2.6. Half-float types

#include <poplar/HalfFloat.hpp>

2.7. Stack size definition

#include <poplar/StackSizeDefs.hpp>

Defines

TOTAL_STACK_USAGE
FUNCTION_IS_WORKER
DEF_STACK_USAGE_HELPER(size, funcname)
DEF_STACK_USAGE(size, funcname)

Used to specify the TOTAL stack usage of a function.

The use of this macro must be placed at file top level (not inside a function definition). This macro will add ‘overrides’ for the stack size information for a C/C++ codelet function (either ‘own’ stack size only, or total stack usage, same as the assembly macros above).

Parameters
  • size: Size in bytes of the total stack usage of ‘funcname’, i.e. includes any function that might be called by funcname. Must be an unsigned integer literal.

  • funcname: A string literal containing the name of the function. If the function is a C++ one, it must be the MANGLED name, so it might be convenient to define such a function as ‘extern “C”’ for ease of use of this macro.

DEF_FUNC_CALL_PTRS(caller_func, called_func_list)

Macro to declare that a function might call other functions via function pointers.

Note that all function names below are strings containing the name of the functions, and if the functions are C++ ones, they must be the MANGLED name, so it might be convenient to define such functions as ‘extern “C”’ for ease of use of this macro. The use of this macro must be placed at file top level (not inside a function definition).

Parameters
  • caller_func: A string literal containing the name of the function that calls other functions via function pointers.

  • called_func_list: a string literal containing a comma separated list of function names that are called via function pointers by ‘caller_func’.

DEF_FUNCTION_AS_WORKER(funcname)

Macro to declare that a function is run in worker context.

The use of this macro must be placed in the same file where the function body is defined, at top level (not inside the function definition). Note that this is not needed for explicit worker vertices entry points (i.e. __runCodelet_XXXXX) and functions called directly by them. It is required only for worker code that is run from supervisor vertices but is not part of a worker vertex.

Parameters
  • funcname: A string literal containing the name of the function. If the function is a C++ one, it must be the MANGLED name, so it might be convenient to define such a function as ‘extern “C”’ for ease of use of the macro.