Poplar and PopLibs
poplar::Module Class Reference

An instance of poplar::Moudle contains all of the information needed to run a program on an IPU device. More...

#include <Module.hpp>

Public Member Functions

void serialize (std::ostream &out) const
 Serialize a module to a stream. More...
 
void forEachLoadableSegment (std::function< void(size_t tile, size_t address, size_t size, const char *data)> f) const
 A method for iterating over all segments of the executable image for each tile, and call a callback that takes the address, size, and pointer to the data of each one. More...
 

Static Public Member Functions

static Module deserialize (std::istream &in, bool checkPackageHash=true)
 Load a module from a stream. More...
 

Detailed Description

An instance of poplar::Moudle contains all of the information needed to run a program on an IPU device.

It can be saved to or loaded from disk.

Member Function Documentation

◆ deserialize()

static Module poplar::Module::deserialize ( std::istream &  in,
bool  checkPackageHash = true 
)
static

Load a module from a stream.

Parameters
inThe stream to read from. It must be seekable.
checkPackageHashFlag to control package hash check (true by default).

◆ forEachLoadableSegment()

void poplar::Module::forEachLoadableSegment ( std::function< void(size_t tile, size_t address, size_t size, const char *data)>  f) const

A method for iterating over all segments of the executable image for each tile, and call a callback that takes the address, size, and pointer to the data of each one.

Empty segments are skipped.

Parameters
fThe callback to run on each segment of the executable image. Note: the tile argument is the poplar tile index, not the physical tile index.
Exceptions
poplar_errorif the target is not an IPU.

◆ serialize()

void poplar::Module::serialize ( std::ostream &  out) const

Serialize a module to a stream.

All of the binary files and metadata needed to run a Poplar module will be written to the stream. Currently the format is opaque, and compatibility between different versions of Poplar is not guaranteed.

Parameters
outThe stream to write to. It must be seekable.
Exceptions
poplar_errorif the target is not an IPU - this cannot be used to serialise CPU or IPU_MODEL modules.

The documentation for this class was generated from the following file: