Poplar and PopLibs
Preallocations.hpp
1// Copyright (c) 2022 Graphcore Ltd. All rights reserved.
2
3#ifndef poplar_Preallocations_hpp
4#define poplar_Preallocations_hpp
5
6#include "poplar/StringRef.hpp"
7#include <cstddef>
8#include <memory>
9
10namespace poplar {
11
12class Device;
13class Target;
14
15namespace core {
16class Preallocations;
17}
18
22 std::unique_ptr<core::Preallocations> impl;
23
24public:
25 Preallocations(const Target &target);
26 Preallocations(const Device &device);
28 Preallocations(Preallocations &&) noexcept;
32 void addAllocation(unsigned tile, std::size_t address, std::size_t size);
35 void addAllocation(unsigned tile, std::size_t address, std::size_t size,
36 StringRef name);
37
38 // Implementation
39 const core::Preallocations &getImpl() const { return *impl; }
40};
41
42} // End namespace poplar.
43
44#endif // poplar_Preallocations_hpp
A device refers to a physical entity that can execute code.
Definition: Device.hpp:26
This class describes where external variables and other pre-existing allocations are in memory.
Definition: Preallocations.hpp:21
void addAllocation(unsigned tile, std::size_t address, std::size_t size)
Add a pre-existing allocation.
void addAllocation(unsigned tile, std::size_t address, std::size_t size, StringRef name)
Add a pre-existing allocation that is linked to an external variable in the graph.
A target representation.
Definition: Target.hpp:69
Poplar classes and functions.
Definition: ArrayRef.hpp:14