Poplar and PopLibs
RuntimeOptions.hpp
1// Copyright (c) 2021 Graphcore Ltd. All rights reserved.
2
3#ifndef poplar_RuntimeOptions_hpp
4#define poplar_RuntimeOptions_hpp
5
6#include <poplar/OptionFlags.hpp>
7
8namespace poplar {
9
10namespace core {
11struct RuntimeOptions;
12}
13
125public:
126 // Name of an environment variable reserved to parse runtime options
127 static const char *EnvVarName;
128
129 // Construct a RuntimeOptions object from a flags object.
130 // Flags from the environment variable are parsed and take precedence.
131 explicit RuntimeOptions(const OptionFlags &options);
132
133 // Copy constructor. Does not parse environment variable.
134 RuntimeOptions(const RuntimeOptions &options);
135
136 // Move constructor. Does not parse environment variable.
138
139 // Copy-assignment operator. Does not parse environment variable.
140 RuntimeOptions &operator=(const RuntimeOptions &);
141
142 // Move-assignment operator. Does not parse environment variable.
143 RuntimeOptions &operator=(RuntimeOptions &&);
144
146
147 bool operator==(const RuntimeOptions &);
148
149 const core::RuntimeOptions *getImpl() const { return impl.get(); }
150
151private:
152 std::unique_ptr<core::RuntimeOptions> impl;
153};
154
155} // namespace poplar
156
157// Hashing support for RuntimeOptions
158namespace std {
159template <> struct hash<poplar::RuntimeOptions> {
160 size_t operator()(const poplar::RuntimeOptions &) const;
161};
162} // namespace std
163
164#endif // poplar_RuntimeOptions_hpp
A set of option/value string flags to be used in various APIs.
Definition: OptionFlags.hpp:24
A group of properties that are reconfigurable in each engine execution.
Definition: RuntimeOptions.hpp:124
Poplar classes and functions.
Definition: ArrayRef.hpp:14