3#ifndef poplar_GraphElements_hpp
4#define poplar_GraphElements_hpp
7#include <poplar/StringRef.hpp>
28 const core::GraphBuilder *graph;
50 VertexRef(
const core::GraphBuilder *graph,
unsigned id)
51 : graph(graph), id(
id) {}
53 friend class core::GraphBuilder;
96 return FieldRef(vertex, fieldId, index);
99 bool isIndexed()
const {
return indexed; }
100 std::size_t getIndex()
const {
return index; }
108 FieldRef(VertexRef vertex, StringRef fieldName);
110 FieldRef(VertexRef vertex,
unsigned fieldId);
116 FieldRef(VertexRef vertex, StringRef fieldName, std::size_t index);
118 FieldRef(VertexRef vertex,
unsigned fieldId, std::size_t index);
120 friend class VertexRef;
132 unsigned computeset_id;
137 ComputeSet(
unsigned id) : computeset_id(
id) {}
138 unsigned getId()
const {
return computeset_id; }
142 return lhs.getId() == rhs.getId();
149 unsigned function_id;
154 Function(
unsigned id) : function_id(
id) {}
155 unsigned getId()
const {
return function_id; }
159 return lhs.getId() == rhs.getId();
165 unsigned function_buffer_id;
170 unsigned getId()
const {
return function_buffer_id; }
174 return lhs.getId() == rhs.getId();
180 unsigned function_id;
184 unsigned getId()
const {
return function_id; }
A reference to a compute set within a graph.
Definition: GraphElements.hpp:131
A reference to a field within a vertex instance.
Definition: GraphElements.hpp:75
FieldRef operator[](std::size_t index) const
Access an element of a vector field.
Definition: GraphElements.hpp:95
A reference to a function buffer stored within a graph.
Definition: GraphElements.hpp:164
A reference to a function stored within a graph.
Definition: GraphElements.hpp:148
This class represents a graph program to be executed on the IPU.
Definition: Graph.hpp:52
A reference to a function in the host.
Definition: GraphElements.hpp:179
A reference to a vertex within a graph.
Definition: GraphElements.hpp:27
FieldRef operator[](StringRef fieldName) const
Access a field by name.
Definition: GraphElements.hpp:123
Poplar classes and functions.
Definition: ArrayRef.hpp:14
unsigned vertex_id
Vertex id.
Definition: GraphElements.hpp:13