Poplar and PopLibs
Vertex.hpp
1// Copyright (c) 2015 Graphcore Ltd. All rights reserved.
2
3#ifndef poplar_Vertex_hpp_
4#define poplar_Vertex_hpp_
5
6#include <poplar/InOutTypes.hpp>
7#include <poplar/TileConstants.hpp>
8#include <poplar/VectorListTypes.hpp>
9#include <poplar/VectorTypes.hpp>
10
11#ifdef __IPU__
12// Worker vertex state must be 4 byte aligned. There is currently no
13// restriction on supervisor state alignment.
14#define WORKER_ALIGN alignas(4)
15#else
16#define WORKER_ALIGN
17#endif
18
19namespace poplar {
20
28class Vertex {};
29
38
43
52public:
54 static inline constexpr unsigned numWorkers() { return CTXT_WORKERS; }
55};
56
59template <bool pred>
60using SupervisorVertexIf = std::conditional_t<pred, SupervisorVertex, Vertex>;
61
62} // End namespace poplar.
63
64#endif // poplar_Vertex_hpp_
ExternalExchangeVertex base class; Any sub-type of this class needs to define a compute() method retu...
Definition: Vertex.hpp:42
MultiVertex base class; Any sub-type of this class needs to define a compute() method taking a single...
Definition: Vertex.hpp:51
static constexpr unsigned numWorkers()
Get the total number of workers that will run this vertex.
Definition: Vertex.hpp:54
SupervisorVertex base class; Any sub-type of this class needs to define a compute() method returning ...
Definition: Vertex.hpp:37
Vertex base class.
Definition: Vertex.hpp:28
Poplar classes and functions.
Definition: ArrayRef.hpp:14
std::conditional_t< pred, SupervisorVertex, Vertex > SupervisorVertexIf
Metafunction that returns a SupervisorVertex if pred is true otherwise a Vertex.
Definition: Vertex.hpp:60