@@ -70,7 +70,9 @@ class Event {
7070 Event (Event&&) = default ;
7171 Event& operator =(Event&&) = default ;
7272
73- void addSample (std::chrono::time_point<std::chrono::system_clock> timestamp, const std::vector<int64_t >& values) {
73+ void addSample (
74+ std::chrono::time_point<std::chrono::system_clock> timestamp,
75+ const std::vector<int64_t >& values) {
7476 assert (values.size () == static_cast <size_t >(instanceCount));
7577 samples_.emplace_back (timestamp, values);
7678 }
@@ -82,7 +84,8 @@ class Event {
8284 [[nodiscard]] int64_t sumAll (const SampleSlice& slice) const ;
8385
8486 // Create list of percentiles
85- PercentileList& percentiles (PercentileList& pcs, const SampleSlice& slice) const ;
87+ PercentileList& percentiles (PercentileList& pcs, const SampleSlice& slice)
88+ const ;
8689
8790 void eraseSamples (int count) {
8891 auto end = samples_.begin ();
@@ -114,26 +117,30 @@ class Event {
114117
115118 // List of collected samples, where each sample has values for
116119 // one or more domain instances
117- using Sample = std::pair<std::chrono::time_point<std::chrono::system_clock>, std::vector<int64_t >>;
120+ using Sample = std::pair<
121+ std::chrono::time_point<std::chrono::system_clock>,
122+ std::vector<int64_t >>;
118123 std::list<Sample> samples_;
119124};
120125
121126class Metric {
122127 public:
123- Metric (std::string name,
124- CUpti_MetricID id,
125- std::vector<CUpti_EventID> events,
126- CUpti_MetricEvaluationMode eval_mode,
127- CuptiMetricApi& cupti_metrics);
128+ Metric (
129+ std::string name,
130+ CUpti_MetricID id,
131+ std::vector<CUpti_EventID> events,
132+ CUpti_MetricEvaluationMode eval_mode,
133+ CuptiMetricApi& cupti_metrics);
128134
129135 struct CalculatedValues {
130136 std::vector<SampleValue> perInstance;
131137 SampleValue total;
132138 };
133139
134- struct CalculatedValues calculate (std::map<CUpti_EventID, Event>& events,
135- std::chrono::nanoseconds sample_duration,
136- const SampleSlice& slice);
140+ struct CalculatedValues calculate (
141+ std::map<CUpti_EventID, Event>& events,
142+ std::chrono::nanoseconds sample_duration,
143+ const SampleSlice& slice);
137144
138145 int instanceCount (std::map<CUpti_EventID, Event>& events) {
139146 return events[events_[0 ]].instanceCount ;
@@ -160,7 +167,10 @@ class Metric {
160167 */
161168class EventGroupSet {
162169 public:
163- EventGroupSet (CUpti_EventGroupSet& set, std::map<CUpti_EventID, Event>& events, CuptiEventApi& cupti);
170+ EventGroupSet (
171+ CUpti_EventGroupSet& set,
172+ std::map<CUpti_EventID, Event>& events,
173+ CuptiEventApi& cupti);
164174 ~EventGroupSet ();
165175
166176 EventGroupSet (const EventGroupSet&) = delete ;
@@ -189,10 +199,11 @@ class EventGroupSet {
189199// The sampler
190200class EventProfiler {
191201 public:
192- explicit EventProfiler (std::unique_ptr<CuptiEventApi> cupti_events,
193- std::unique_ptr<CuptiMetricApi> cupti_metrics,
194- std::vector<std::unique_ptr<SampleListener>>& loggers,
195- std::vector<std::unique_ptr<SampleListener>>& onDemandLoggers);
202+ explicit EventProfiler (
203+ std::unique_ptr<CuptiEventApi> cupti_events,
204+ std::unique_ptr<CuptiMetricApi> cupti_metrics,
205+ std::vector<std::unique_ptr<SampleListener>>& loggers,
206+ std::vector<std::unique_ptr<SampleListener>>& onDemandLoggers);
196207 EventProfiler (const EventProfiler&) = delete ;
197208 EventProfiler& operator =(const EventProfiler&) = delete ;
198209 ~EventProfiler ();
@@ -254,7 +265,8 @@ class EventProfiler {
254265
255266 void eraseReportedSamples () {
256267 int erase_count = baseSamples_;
257- if (onDemandConfig_ && onDemandConfig_->eventProfilerOnDemandDuration ().count () > 0 ) {
268+ if (onDemandConfig_ &&
269+ onDemandConfig_->eventProfilerOnDemandDuration ().count () > 0 ) {
258270 erase_count = std::min (baseSamples_, onDemandSamples_);
259271 }
260272 eraseSamples (erase_count);
@@ -288,9 +300,10 @@ class EventProfiler {
288300 }
289301
290302 // Notify listeners of collected samples
291- void dispatchSamples (const Config& config,
292- const std::vector<std::unique_ptr<SampleListener>>& loggers,
293- int report_nr);
303+ void dispatchSamples (
304+ const Config& config,
305+ const std::vector<std::unique_ptr<SampleListener>>& loggers,
306+ int report_nr);
294307
295308 void eraseSamples (int count) {
296309 for (auto & pair : events_) {
0 commit comments