VertexIntrospector
#include <poplar/VertexIntrospector.hpp>
-
namespace poplar
Poplar classes and functions.
-
class FieldData
- #include <VertexIntrospector.hpp>
Information about a vertex field, including its size and its initial value, if set.
This is used when calculating cycle estimates.
Vertex fields can be scalar, 1D or 2D. For example:
The sizes of vertex fields can always be returned, and the initial values can be returned for non-edge fields (
float
,Vector<float>
) and edge fields (Input
and so on) that are connected to constants.Note that 2D fields are vectors of vectors, in other words they are jagged 2D arrays.
Public Functions
-
virtual ~FieldData()
-
unsigned rank() const
Return the rank of the field.
0 for scalar fields
1 for 1D
2 for 2D.
-
std::size_t size() const
Determine the size of the field.
- Returns
For scalar fields it returns 1, for 1D fields it returns the size of the vector, and for 2D fields it returns the number of sub-vectors.
-
std::size_t getSizeAtIndex(std::size_t i) const
Determine the size of the sub-vector for 2D fields.
Throws an error if called on non-2D fields.
- Parameters
i – Index of the sub-vector in the 2D field.
- Returns
Return the size of the sub-vector for 2D fields.
-
layout::Vector getProfilerVectorLayout(std::size_t nestingLevel) const
Determine the layout for vector fields.
- Parameters
i – The dimension to query, 0 for the outer vector, 1 for the inner.
- Returns
The layout for vector fields.
-
layout::VectorList getProfilerVectorListLayout() const
For VectorList fields, return the layout.
We only support introspecting a VectorList that is the outermost vector.
-
inline SizeT operator[](std::size_t i) const
Determine size of field.
This is an alternate to getSizeAtIndex(). Instead of
field.getSizeAtIndex(i)
you can usefield[i].size()
.
-
template<typename T>
inline T getInitialValue(const Target &target) const Get the inital value for a scalar field.
T
must be of type scalar. Throws an error if this is not a scalar field.
Private Functions
-
template<typename T>
inline void getInitialValuesOverload(const Target &target, std::vector<T> &result) const
-
struct SizeT
-
virtual ~FieldData()
-
class VertexIntrospector
- #include <VertexIntrospector.hpp>
Available to cycle estimators to inspect the shape and initial values of a vertex’s fields.
Public Functions
-
FieldData getFieldInfo(const std::string &name) const
Information about the vertex field.
- Parameters
name – The name of the vertex field as defined in its codelet.
- Returns
Information about the vertex field.
-
ComputeSet getComputeSet() const
Return the compute set that this vertex is in.
-
VertexIntrospector(VertexIntrospector&&) noexcept
-
FieldData getFieldInfo(const std::string &name) const
-
namespace core
-
class FieldData