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.
-
using SupervisorVertexIf = std::conditional_t<pred, SupervisorVertex, Vertex>
2.2. Input & output types
#include <poplar/InOutTypes.hpp>
Defines
-
NO_INSTRUMENT
-
namespace poplar
Poplar classes and functions.
-
struct InOutBase
Subclassed by poplar::InOut< T >, poplar::Input< T >, poplar::Output< T >
Public Members
-
void *p
-
void *p
-
struct InOutBase
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.
-
enumerator NOT_A_VECTOR
-
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.
-
enumerator NOT_A_VECTOR
-
enum VectorLayout
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>
-
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>
-
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>
-
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>
-
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>
-
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>
-
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>
-
using type = OnePtrVectorBaseImplicitDeref<UnboxIO_t<T>, MinAlign>
-
template<typename T, unsigned MinAlign, bool Interleaved>
struct poplar::detail::ImplicitVLayoutEnumToType<T, VectorLayout::SCALED_PTR32, MinAlign, Interleaved> Public Types
-
using type = ScaledPtr32VectorBaseImplicitDeref<UnboxIO_t<T>, MinAlign>
-
using type = ScaledPtr32VectorBaseImplicitDeref<UnboxIO_t<T>, MinAlign>
-
template<typename T, unsigned MinAlign, bool Interleaved>
struct poplar::detail::ImplicitVLayoutEnumToType<T, VectorLayout::SCALED_PTR64, MinAlign, Interleaved> Public Types
-
using type = ScaledPtr64VectorBaseImplicitDeref<UnboxIO_t<T>, MinAlign>
-
using type = ScaledPtr64VectorBaseImplicitDeref<UnboxIO_t<T>, MinAlign>
-
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
-
inline void *begin() const
-
inline 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>.
-
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
-
using iterator = typename Vector<std::enable_if<L == VectorLayout::SPAN, T>, VectorLayout::SPAN, MinAlign, Interleaved>::const_iterator
-
template<typename T, unsigned MinAlign>
class OnePtrVectorBase : public poplar::BaseWithAlign<PtrBase, MinAlign> -
Public Functions
-
inline const_iterator begin() const
Private Types
-
using Base = BaseWithAlign<PtrBase, MinAlign>
-
inline const_iterator begin() const
-
template<typename T, unsigned MinAlign>
class OnePtrVectorBaseImplicitDeref : public poplar::PtrBase Public Types
Public Functions
-
inline const_iterator begin() const
-
inline const_iterator begin() const
-
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>.
-
struct PtrBase
Subclassed by poplar::BaseWithAlign< PtrBase, MinAlign >, poplar::OnePtrVectorBaseImplicitDeref< T, MinAlign >
Public Functions
-
inline void *begin() const
Public Members
-
void *ptr
-
inline void *begin() const
-
struct ScaledBase128
Subclassed by poplar::BaseWithAlign< ScaledBase128, MinAlign >, poplar::ScaledPtr128VectorBaseImplicitDeref< T, MinAlign >
Public Functions
-
ScaledBase128() = default
-
inline void set(void *p)
-
inline ScaledBase128(void *p)
-
inline void *begin() const
Public Members
-
unsigned short pOffset
-
ScaledBase128() = default
-
struct ScaledBase32
Subclassed by poplar::BaseWithAlign< ScaledBase32, MinAlign >, poplar::ScaledPtr32VectorBaseImplicitDeref< T, MinAlign >
Public Functions
-
ScaledBase32() = default
-
inline void set(void *p)
-
inline ScaledBase32(void *p)
-
inline void *begin() const
Public Members
-
unsigned short pOffset
Public Static Attributes
-
static const uintptr_t memBase = 0x40000
-
ScaledBase32() = default
-
struct ScaledBase64
Subclassed by poplar::BaseWithAlign< ScaledBase64, MinAlign >, poplar::ScaledPtr64VectorBaseImplicitDeref< T, MinAlign >
Public Functions
-
ScaledBase64() = default
-
inline void set(void *p)
-
inline ScaledBase64(void *p)
-
inline void *begin() const
Public Members
-
unsigned short pOffset
-
ScaledBase64() = default
-
template<typename T, unsigned MinAlign>
class ScaledPtr128VectorBase : public poplar::BaseWithAlign<ScaledBase128, MinAlign> -
Public Functions
-
inline const_iterator begin() const
Private Types
-
using Base = BaseWithAlign<ScaledBase128, MinAlign>
-
inline const_iterator begin() const
-
template<typename T, unsigned MinAlign>
class ScaledPtr128VectorBaseImplicitDeref : public poplar::ScaledBase128 Public Types
Public Functions
-
inline const_iterator begin() const
Private Types
-
using Base = ScaledBase128
-
inline const_iterator begin() const
-
template<typename T, unsigned MinAlign>
class ScaledPtr32VectorBase : public poplar::BaseWithAlign<ScaledBase32, MinAlign> -
Public Functions
-
inline const_iterator begin() const
Private Types
-
using Base = BaseWithAlign<ScaledBase32, MinAlign>
-
inline const_iterator begin() const
-
template<typename T, unsigned MinAlign>
class ScaledPtr32VectorBaseImplicitDeref : public poplar::ScaledBase32 Public Types
Public Functions
-
inline const_iterator begin() const
Private Types
-
using Base = ScaledBase32
-
inline const_iterator begin() const
-
template<typename T, unsigned MinAlign>
class ScaledPtr64VectorBase : public poplar::BaseWithAlign<ScaledBase64, MinAlign> -
Public Functions
-
inline const_iterator begin() const
Private Types
-
using Base = BaseWithAlign<ScaledBase64, MinAlign>
-
inline const_iterator begin() const
-
template<typename T, unsigned MinAlign>
class ScaledPtr64VectorBaseImplicitDeref : public poplar::ScaledBase64 Public Types
Public Functions
-
inline const_iterator begin() const
Private Types
-
using Base = ScaledBase64
-
inline const_iterator begin() const
-
template<typename T, unsigned MinAlign>
class ShortSpanVectorBase : public poplar::BaseWithAlign<ShortVectorBase, MinAlign> -
Public Functions
-
inline const_iterator begin() const
-
inline const_iterator end() const
-
inline bool empty() const
Private Types
-
using Base = BaseWithAlign<ShortVectorBase, MinAlign>
-
inline const_iterator begin() const
-
template<typename T, unsigned MinAlign>
class ShortSpanVectorBaseImplicitDeref : public poplar::ShortVectorBase Public Types
Public Functions
-
inline const_iterator begin() const
-
inline const_iterator end() const
-
inline bool empty() const
Private Types
-
using Base = ShortVectorBase
-
inline const_iterator begin() const
-
struct ShortVectorBase
Subclassed by poplar::BaseWithAlign< ShortVectorBase, MinAlign >, poplar::ShortSpanVectorBaseImplicitDeref< T, MinAlign >
-
template<typename T, unsigned MinAlign>
class SpanVectorBase : public poplar::BaseWithAlign<VectorBase, MinAlign> -
Public Functions
-
inline const_iterator begin() const
-
inline const_iterator end() const
-
inline bool empty() const
Private Types
-
using Base = BaseWithAlign<VectorBase, MinAlign>
-
inline const_iterator begin() const
-
template<typename T, unsigned MinAlign>
class SpanVectorBaseImplicitDeref : public poplar::VectorBase Public Types
Public Functions
-
inline const_iterator begin() const
-
inline const_iterator end() const
-
inline bool empty() const
Private Types
-
using Base = VectorBase
-
inline const_iterator begin() 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 >
-
namespace detail
-
Functions
-
constexpr VectorLayout resolveCompactPtr(const VectorLayout layout, const unsigned minAlign)
-
inline 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>
-
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>
-
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>
-
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>
-
using type = SpanVectorBaseImplicitDeref<UnboxIO_t<T>, MinAlign>
-
template<typename T>
struct UnboxIO
-
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>
-
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>
-
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>
-
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>
-
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>
-
using type = SpanVectorBase<UnboxIO_t<T>, MinAlign>
-
constexpr VectorLayout resolveCompactPtr(const VectorLayout layout, const unsigned minAlign)
-
template<class Base, unsigned 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>
-
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>
-
using type = BaseAndDeltasElements<T, MinAlign>
-
namespace poplar
Poplar classes and functions.
-
template<typename T, unsigned MinAlign>
struct BaseAndDelta Public Functions
-
inline void *begin() const
-
inline BaseAndDelta &operator++()
-
inline bool operator==(const BaseAndDelta &rhs) const
-
inline bool operator!=(const BaseAndDelta &rhs) const
-
inline size_t size() const
-
inline bool empty() const
-
inline void *begin() const
-
template<typename T, unsigned MinAlign>
struct BaseAndDeltaElements Public Functions
-
inline void *begin() const
-
inline BaseAndDeltaElements &operator++()
-
inline bool operator==(const BaseAndDeltaElements &rhs) const
-
inline bool operator!=(const BaseAndDeltaElements &rhs) const
-
inline size_t size() const
-
inline bool empty() const
-
inline void *begin() const
-
struct BaseAndDeltaElementsBase
Subclassed by poplar::BaseAndDeltasElements< T, MinAlign >
Public Functions
-
BaseAndDeltaElementsBase() = delete
-
inline unsigned size() const
-
inline uintptr_t getBase() const
-
inline DeltaNElements *getDeltaN() const
-
BaseAndDeltaElementsBase() = delete
-
template<typename T, unsigned MinAlign>
struct BaseAndDeltas : public poplar::BaseAndDeltasBase Public Types
-
typedef BaseAndDelta<T, MinAlign> iterator
-
typedef BaseAndDelta<T, MinAlign> iterator
-
struct BaseAndDeltasBase
Subclassed by poplar::BaseAndDeltas< T, MinAlign >
-
template<typename T, unsigned MinAlign>
struct BaseAndDeltasElements : public poplar::BaseAndDeltaElementsBase Public Types
-
typedef BaseAndDeltaElements<T, MinAlign> iterator
-
typedef BaseAndDeltaElements<T, MinAlign> iterator
-
struct DeltaN
-
struct DeltaNElements
Public Functions
-
inline unsigned getN(unsigned alignment) const
-
inline unsigned getOffset(unsigned alignment) const
Public Members
-
uint32_t packedBits
Public Static Functions
-
static inline constexpr unsigned log2(unsigned n)
-
inline unsigned getN(unsigned alignment) const
-
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
-
inline const VectorList<T, L, MinAlign, Interleaved> &operator*() const
-
inline const VectorList<T, L, MinAlign, Interleaved> *operator->() const
-
inline VectorList<T, L, MinAlign, Interleaved> &operator*()
-
inline VectorList<T, L, MinAlign, Interleaved> *operator->()
-
inline const VectorList<T, L, MinAlign, Interleaved> &operator*() const
-
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
-
inline const VectorList<T, L, MinAlign, Interleaved> &operator*() const
-
inline const VectorList<T, L, MinAlign, Interleaved> *operator->() const
-
inline 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
-
inline const VectorList<T, L, MinAlign, Interleaved> &operator*() const
-
inline const VectorList<T, L, MinAlign, Interleaved> *operator->() const
-
inline VectorList<T, L, MinAlign, Interleaved> &operator*()
-
inline VectorList<T, L, MinAlign, Interleaved> *operator->()
-
inline const VectorList<T, L, MinAlign, Interleaved> &operator*() const
-
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>
-
using type = BaseAndDeltas<T, MinAlign>
- template<typename T, unsigned MinAlign, bool Interleaved> DELTANELEMENTS, MinAlign, Interleaved >
Public Types
-
using type = BaseAndDeltasElements<T, MinAlign>
-
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 >
-
constexpr VectorListLayout resolveCompactDeltaN(const VectorListLayout layout)
-
template<typename T, unsigned MinAlign>
2.6. Half-float types
#include <poplar/HalfFloat.hpp>
-
namespace std
-
template<>
class numeric_limits<half> - #include <HalfFloat.hpp>
std::numeric_limits<> for poplar::half.
We cannot use
constexpr
for the functions returning the types becauseIeeeHalf
does not yet haveconstexpr
constructors. That is because the conversion functions inIeeeHalf
are too complex for C++11constexpr
’s which are very limited.Public Types
-
typedef half type
Public Static Functions
Public Static Attributes
-
static constexpr bool is_specialized = true
-
static constexpr const bool is_signed = true
-
static constexpr const int digits = 11
-
static constexpr const int digits10 = 3
-
static constexpr const int max_digits10 = 5
-
static constexpr const bool is_integer = false
-
static constexpr const bool is_exact = false
-
static constexpr const int radix = 2
-
static constexpr const int min_exponent = -13
-
static constexpr const int min_exponent10 = -4
-
static constexpr const int max_exponent = 16
-
static constexpr const int max_exponent10 = 4
-
static constexpr const bool has_infinity = false
-
static constexpr const bool has_quiet_NaN = true
-
static constexpr const bool has_signaling_NaN = false
-
static constexpr const float_denorm_style has_denorm = denorm_present
-
static constexpr const bool has_denorm_loss = false
-
static constexpr const bool is_iec559 = false
-
static constexpr const bool is_bounded = true
-
static constexpr const bool is_modulo = false
-
static constexpr const bool traps = false
-
static constexpr const bool tinyness_before = false
-
static constexpr const float_round_style round_style = round_indeterminate
-
typedef half type
-
template<>
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.