Executable

#include <poplar/Executable.hpp>
namespace poplar

Poplar classes and functions.

class Executable
#include <Executable.hpp>

An instance of poplar::Executable 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

~Executable()
Executable()
Executable(Executable &&other) noexcept
Executable &operator=(Executable &&other) noexcept
void serialize(std::ostream &out) const

Serialize an executable to a stream.

All of the binary files and metadata needed to run a Poplar executable 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 cannot be used to serialise CPU or IPU_MODEL executables.

explicit Executable(std::shared_ptr<const core::Executable> impl)
inline std::shared_ptr<const core::Executable> getImpl() const

Public Static Functions

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

Load an executable from a stream.

Parameters
  • in – The stream to read from. It must be seekable.

  • checkPackageHash – Flag to control package hash check (true by default).

static Executable deserialize(std::unique_ptr<std::istream> in, bool checkPackageHash = true)

Load an executable from a stream.

Note

This overload used to be more efficient by avoiding copying the archive from the executable to a temporary file. However now the executable needs to be decompressed this interface also stores the decompressed archive in a temporary file and so is equivalent to the other overload.

Parameters
  • in – The stream to read from.

  • checkPackageHash – Flag to control package hash check (true by default).

Private Members

std::shared_ptr<const core::Executable> impl
namespace core