GraphElements

#include <poplar/GraphElements.hpp>
namespace poplar

Poplar classes and functions.

Typedefs

typedef unsigned vertex_id

Vertex id.

The integral type of unique identifiers to vertices with a graph.

Functions

inline bool operator==(const ComputeSet &lhs, const ComputeSet &rhs)
inline bool operator==(const Function &lhs, const Function &rhs)
inline bool operator==(const FunctionBuffer &lhs, const FunctionBuffer &rhs)
class ComputeSet
#include <GraphElements.hpp>

A reference to a compute set within a graph.

This type provides a way to address compute sets within a graph.

Public Functions

inline ComputeSet()
inline ComputeSet(unsigned id)
inline unsigned getId() const

Private Members

unsigned computeset_id
class FieldRef
#include <GraphElements.hpp>

A reference to a field within a vertex instance.

This type provides a way to address fields (inputs or internal state) within a vertex. FieldRef’s are normally obtained using VertexRef::operator[](StringRef fieldName), for example:

VertexRef vertex = graph.addVertex(...);
FieldRef input = vertex["input"];
graph.connect(input, ...);

A FieldRef can also be indexed, for example:

FieldRef input_5 = vertex["input"][5];

This is used when a field is a list of regions, for example a Vector<Input<Vector<...>>> or an Input<VectorList<...>>.

Public Functions

inline FieldRef()
inline FieldRef operator[](std::size_t index) const

Access an element of a vector field.

Subscript a vector field to access the element at position index.

Parameters

index – The subscript of the field

Returns

A reference to the field.

inline bool isIndexed() const
inline std::size_t getIndex() const

Public Members

VertexRef vertex
unsigned fieldId
std::size_t index
bool indexed

Private Functions

FieldRef(VertexRef vertex, StringRef fieldName)

FieldRef constructor from vertex id and field name.

Construct a FieldRef out of a vertex id and the name of the field.

FieldRef(VertexRef vertex, unsigned fieldId)
FieldRef(VertexRef vertex, StringRef fieldName, std::size_t index)

FieldRef constructor from vertex id, field name and an index.

Construct a FieldRef to a Vector field.

FieldRef(VertexRef vertex, unsigned fieldId, std::size_t index)

Friends

friend class VertexRef
class Function
#include <GraphElements.hpp>

A reference to a function stored within a graph.

Public Functions

inline Function()
inline Function(unsigned id)
inline unsigned getId() const

Private Members

unsigned function_id
class FunctionBuffer
#include <GraphElements.hpp>

A reference to a function buffer stored within a graph.

Public Functions

inline FunctionBuffer()
inline explicit FunctionBuffer(unsigned id)
inline unsigned getId() const

Private Members

unsigned function_buffer_id
class HostFunction
#include <GraphElements.hpp>

A reference to a function in the host.

Public Functions

inline HostFunction(unsigned id)
inline unsigned getId() const

Private Members

unsigned function_id
class VertexRef
#include <GraphElements.hpp>

A reference to a vertex within a graph.

This type provides a way to address vertices within a graph.

Public Functions

inline VertexRef()
inline FieldRef operator[](StringRef fieldName) const

Access a field by name.

Given a vertex reference v, v[name] is a field reference.

Parameters

fieldName – The name of the field.

Returns

A reference to the named field.

inline vertex_id getId() const

Private Functions

inline VertexRef(const core::GraphBuilder *graph, unsigned id)

Construct a vertex reference from an ID.

Parameters

graph – The graph containing the vertex. \ param id The id of the vertex.

Returns

A reference to the vertex.

Private Members

const core::GraphBuilder *graph
vertex_id id

Friends

friend class core::GraphBuilder
friend class Graph
friend class FieldRef
namespace core