ProfileValue
#include <poplar/ProfileValue.hpp>
-
namespace poplar
Poplar classes and functions.
Functions
-
void serializeToJSON(std::ostream &out, const ProfileValue &val, bool prettyPrint = false)
-
void serializeToCBOR(std::ostream &out, const ProfileValue &val, bool withTag = true)
-
std::ostream &operator<<(std::ostream &os, const ProfileValue &v)
Dumps the JSON representation to an output stream.
-
void printGraphSummary(std::ostream &out, const std::string &databasePath, const OptionFlags &opts)
Print a summary of the static graph profiling information - primarily memory use.
showOptimizations
(true, false) [=false]If true, information about the optimisations performed are included in the summary output.
showPerIpuMemoryUsage
(true, false) [=false]If true, total memory usage per-IPU is included in the summary output in addition to memory usage for the whole device.
showVarStorage
(true, false) [=false]If true, information about variable storage liveness is included in the summary output. This is provided for some tiles with the highest maximum live bytes as well as a total for all tiles. The maximum live bytes is output along with information about always-live variables.
colours
(true, false)Specify whether colours should be displayed in the profile report. If not set, colours will be displayed only if outputting to a supported terminal. If not set, using environment variable
CLICOLOR_FORCE=1
forces colours to be displayed, whileCLICOLOR=0
disables colours.
- Parameters
out – The output stream to which the summary will be written.
databasePath – The full pathname of the
profile.pop
file for which the summary will be printed.opts – The set of option flags configuring the contents of the summary. The available options are:
-
void printExecutionSummary(std::ostream &out, const std::string &databasePath, const OptionFlags &opts)
Print a summary of the execution profiling information - primarily cycle counts.
The information printed depends on the target and the execution profiling mode. IPUModel always prints a simulation of execution.
showExecutionSteps
(true, false) [=false]If true, the program execution sequence with cycle estimates is included in the summary output.
colours
(true, false)See printGraphSummary().
- Parameters
out – The output stream to which the summary will be written.
databasePath – The full pathname of the
profile.pop
file for which the summary will be printed.opts – The set of option flags configuring the contents of the summary. The available options are:
-
void printProfileSummary(std::ostream &out, const std::string &databasePath, const OptionFlags &opts = {})
Equivalent to calling printGraphSummary() followed by printExecutionSummary().
- Parameters
out – The output stream to which the summary will be written.
databasePath – The full pathname of the
profile.pop
file for which the summary will be printed.opts – The set of option flags configuring the contents of the summary. See printGraphSummary() and printExecutionSummary().
-
class ProfileValue
- #include <ProfileValue.hpp>
ProfileValue represents a read-only JSON-like tree of values that are used to store the output of the profiler.
Each value can be one of:
A boolean
A string
A double-precision number
A vector<> of child values
A map<string, …> of child values. Only string keys are supported.
If an invalid access is made, for example an out-of-range access or accessing the wrong type, then an exception is thrown. It is possible to write code that should never throw an exception by using type().
See the Poplar and PopLibs User Guide for details of the data in the report.
Public Types
-
enum class Type
Values:
-
enumerator BOOL_
-
enumerator STRING
-
enumerator NUMBER
-
enumerator VECTOR
-
enumerator MAP
-
enumerator BOOL_
-
using Boolean = bool
-
using Number = double
-
using Vector = std::vector<ProfileValue>
-
using Map = std::map<std::string, ProfileValue>
Public Functions
-
double asDouble() const
-
const ProfileValue &operator[](StringRef s) const
-
const ProfileValue *getOrNull(StringRef s) const
-
const ProfileValue &operator[](std::size_t i) const
-
double sumDouble() const
-
bool operator==(const ProfileValue &other) const
-
bool operator!=(const ProfileValue &other) const
-
inline ProfileValue()
-
template<class T, typename = typename std::enable_if<std::is_integral<T>::value>::type>
inline ProfileValue(T init)
-
inline ProfileValue(const char *init)
-
~ProfileValue()
-
ProfileValue(const ProfileValue &other)
-
ProfileValue(ProfileValue &&other) noexcept
-
ProfileValue &operator=(const ProfileValue &other)
-
ProfileValue &operator=(ProfileValue &&other) noexcept
-
ProfileValue &operator=(Boolean init)
-
ProfileValue &operator=(Number init)
-
ProfileValue &operator=(String init)
-
ProfileValue &operator=(Vector init)
-
ProfileValue &operator=(Map init)
Friends
- friend class core::MutableProfileValue
-
struct Storage
-
namespace core
-
void serializeToJSON(std::ostream &out, const ProfileValue &val, bool prettyPrint = false)