#include <gcl/TileAllocation.hpp>



Produce compile time warning for unused return values.

namespace gcl

Graphcore Communications Library.

CrossReplica functions

Collective operations working across replicas.

WithinReplica functions

Collective operations working within replicas.


unsigned getMinIoTiles(const poplar::Graph &graph)

Get the minimum number of IO tiles required for GCL operations.

This is the minimum number of tiles you must ask for in perIPUTiles() for it to be a valid graph for GCL operations.


graph – The graph to check. It assumes that all tiles in the graph will be used for IO operations.


The smallest number of IO tiles that must be allocated for GCL operations.

std::vector<unsigned> perIPUTiles(const poplar::Graph &graph, unsigned offset, unsigned count, bool sorted = true, bool tilePairs = true)

Return a list of tile IDs optimal for GCL collective operations.

A set of tiles are chosen with an optimal distribution across exchange blocks and exchange-block contexts. (Exchange blocks provide the hardware interface to off-chip IO.)

  • graph – The graph on which to allocate tiles.

  • offset – Skip a number of tiles and allocate from an offset. This is useful if you want to call the function multiple times, for example to get a set of tiles for IO and another set of tiles for compute. In that case, you could it twice: first with an offset of zero to get the IO tiles, and then with offset equal to the number of IO tiles in order to get the compute tiles.

  • count – Number of tiles IDs to return.

  • sorted – If true the function will sort the returned list of IDs. This is normally required and is the default.

  • tilePairs – Override the default behaviour and return tile pairs. Tiles used for host IO must be allocated in pairs.


A vector of tile IDs.