An instance of poplar::Moudle contains all of the information needed to run a program on an IPU device.
More...
#include <Module.hpp>
|
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...
|
|
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.
◆ deserialize()
static Module poplar::Module::deserialize |
( |
std::istream & |
in, |
|
|
bool |
checkPackageHash = true |
|
) |
| |
|
static |
Load a module from a stream.
- Parameters
-
in | The stream to read from. It must be seekable. |
checkPackageHash | Flag 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
-
f | The 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
-
◆ 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
-
out | The stream to write to. It must be seekable. |
- Exceptions
-
poplar_error | if 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: