CycleCount

#include <poplar/CycleCount.hpp>
namespace poplar

Poplar classes and functions.

Functions

poplar::Tensor cycleCount(poplar::Graph &graph, poplar::program::Sequence &prog, unsigned tile, SyncType syncType, const DebugContext &debugContext = {})

Time the program for a given a sequence program type.

The result is returned as a 64-bit value in a tensor of two unsigned integers. The first element of the tensor is the lower 32 bits and the second element is the upper 32 bits. The sequence is timed by adding sync and timing programs around the original sequence. You must also specify the tile on which the program is to be timed.

Parameters
  • graph – The Poplar graph.

  • prog – The program sequence to time.

  • tile – The tile on which the program is timed.

  • syncType – The type of synchronisation to wrap the original sequence in.

  • debugContext – Optional debug context.

Returns

An unsigned integer tensor of length 2.

poplar::Tensor cycleStamp(poplar::Graph &graph, poplar::program::Sequence &prog, unsigned tile, SyncType syncType, const DebugContext &debugContext = {})

Add a sequence program to record an absolute hardware cycle stamp on a given tile.

The stamp is a snapshot of a continuously running hardware counter on a tile. For consistent results, measurements must be done on the same tile.

The result is a tensor containing two 32-bit elements of a 64-bit snapshot of the hardware counter. The first element of the tensor is the lower 32 bits and the second the upper 32 bits.

The timestamp is added after a sync is executed.

Parameters
  • graph – The Poplar graph.

  • prog – The program sequence to which the time stamp is added.

  • tile – The tile on which the time stamp is added.

  • syncType – The type of synchronisation to perform before stamping.

  • debugContext – Optional debug context.

Returns

An unsigned integer tensor of length 2.

std::vector<poplar::Tensor> cycleStamp(poplar::Graph &graph, poplar::program::Sequence &prog, const std::vector<unsigned> &tiles, SyncType syncType, const DebugContext &debugContext = {})

Add a compute set to record an absolute hardware cycle stamp on the specified tiles.

Parameters
  • graph – The Poplar graph.

  • prog – The program sequence to which the time stamp is added.

  • tiles – The tiles on which the time stamp is added.

  • syncType – The type of synchronisation to perform before stamping.

  • debugContext – Optional debug context.

Returns

A vector of tensors of 2 integers.