Module
#include <poplar/Module.hpp>
-
namespace poplar
Poplar classes and functions.
-
class Module
- #include <Module.hpp>
An instance of poplar::Module contains all of the information needed to run a program on an IPU device.
It can be saved to or loaded from disk.
Public Functions
-
~Module()
-
Module()
-
void 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
out – The stream to write to. It must be seekable.
- Throws
poplar_error – if the target is not an IPU. This class cannot be used to serialise CPU or IPU_MODEL modules.
-
void forEachSegment(std::function<void(size_t tile, size_t address, size_t fileSize, size_t memorySize, const char *data)> f) const
A method for iterating over all segments of the executable image for each tile, with a callback that takes the address, size, and pointer to the data of each one.
- Parameters
f – The callback to run on each segment of the executable image. Note that the
tile
argument is the Poplar tile index, not the physical tile index.- Throws
poplar_error – if the target is not an IPU.
-
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.
With a callback that takes the address, size, and pointer to the data of each one. Empty segments are skipped.
- Parameters
f – The callback to run on each segment of the executable image. Note that the
tile
argument is the Poplar tile index, not the physical tile index.- Throws
poplar_error – if the target is not an IPU.
Public Static Functions
-
~Module()
-
namespace core
-
class Module