Poplar and PopLibs
PerfEstimateFunc.hpp
1// Copyright (c) 2021 Graphcore Ltd. All rights reserved.
2
3#ifndef poplar_PerfEstimateFunc_hpp
4#define poplar_PerfEstimateFunc_hpp
5#include <cstdint>
6#include <functional>
7
8namespace poplar {
9class VertexIntrospector;
10class Target;
11
12struct VertexPerfEstimate {
13 std::uint64_t cycles;
14 std::uint64_t flops;
15 VertexPerfEstimate() = default;
16 VertexPerfEstimate(std::uint64_t cycles, std::uint64_t flops = 0)
17 : cycles(cycles), flops(flops) {}
18};
19
24using PerfEstimateFunc = std::function<VertexPerfEstimate(
25 const VertexIntrospector &v, const Target &target)>;
26
27} // namespace poplar
28
29#endif // poplar_PerfEstimateFunc_hpp
A target representation.
Definition: Target.hpp:69
Available to cycle estimators to inspect the shape and initial values of a vertex's fields.
Definition: VertexIntrospector.hpp:188
Poplar classes and functions.
Definition: ArrayRef.hpp:14
std::function< VertexPerfEstimate(const VertexIntrospector &v, const Target &target)> PerfEstimateFunc
Functions of this type can be used as performance estimator callbacks for new vertex types.
Definition: PerfEstimateFunc.hpp:25