Poplar and PopLibs
Module.hpp
1// Copyright (c) 2022 Graphcore Ltd. All rights reserved.
2#ifndef poplar_Module_hpp
3#define poplar_Module_hpp
4
5#include <functional>
6#include <memory>
7
8namespace poplar {
9
10namespace core {
11class Executable;
12}
13
17class Module {
18public:
19 ~Module();
20
21 Module();
22 Module(Module &&other) noexcept;
23 Module &operator=(Module &&other) noexcept;
24 explicit Module(std::unique_ptr<core::Executable> impl);
25
36 void serialize(std::ostream &out) const;
37
44 static Module deserialize(std::istream &in, bool checkPackageHash = true);
45
46 const core::Executable &getImpl() const { return *impl; }
47
58 void forEachLoadableSegment(std::function<void(size_t tile, size_t address,
59 size_t size, const char *data)>
60 f) const;
61
62private:
63 std::unique_ptr<core::Executable> impl;
64};
65
66} // namespace poplar
67
68#endif // poplar_Module_hpp
An instance of poplar::Moudle contains all of the information needed to run a program on an IPU devic...
Definition: Module.hpp:17
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 t...
void serialize(std::ostream &out) const
Serialize a module to a stream.
static Module deserialize(std::istream &in, bool checkPackageHash=true)
Load a module from a stream.
Poplar classes and functions.
Definition: ArrayRef.hpp:14