FieldTypes

#include <poplar/FieldTypes.hpp>
namespace poplar

Poplar classes and functions.

Enums

enum class VectorLayout : unsigned

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 1 MiB can be represented.

enumerator ONE_PTR

Similar to 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

Similar to 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

Similar to 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 512 KiB can be represented.

enumerator SCALED_PTR128

Similar to 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 1 MiB can be represented.

enumerator COMPACT_PTR

This pointer type will resolve into the best suited, ideally space optimised, pointer given 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 class VectorListLayout : unsigned

The memory layout used for a VectorList.

The ONE_PTR and SCALED_PTR* types are for Poplar runtime internal use only.

Values:

enumerator NOT_A_VECTOR
enumerator ONE_PTR

Poplar runtime use only.

enumerator SCALED_PTR32

Poplar runtime use only.

enumerator SCALED_PTR64

Poplar runtime use only.

enumerator SCALED_PTR128

Poplar runtime use only.

enumerator DELTAN

A top-level structure with a 20-bit pointer to the base of the vector data, a 12 bit count for the number of sub-vectors and a SCALED_PTR32 pointer to an array of structures for each sub-vector.

These each have an 18-bit offset from the base address to the sub-vector data, and a 14-bit count for the size of the sub-vector. The maximum number of sub-vectors is 4,095. The maximum number of elements in a sub-vector is 16,383 elements. The .size() method and iterators are available.

enumerator DELTANELEMENTS

A top-level structure with a 21-bit pointer to the base of the vector data, a 16 bit count for the number of sub-vectors and a 21-bit pointer to an array of structures for each sub-vector.

These each have an offset from the base address to the sub-vector data, and a count for the size of the sub-vector. The offset and count are packed into a 32-bit word. For byte-aligned data, the offset is 21 bits and the count is 11 bits. For larger alignments, fewer bits are required for the offset and more bits are available for the count. The maximum number of sub-vectors is 65,535. The maximum size of the sub-vectors depends on the data type. The .size() method and iterators are available.

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 IPUs it will be a DELTAN type, as that can point to everything in the available memory.