stream_ordered_timing.hpp
1 
5 #pragma once
6 
7 #include <memory>
8 #include <optional>
9 #include <string>
10 
11 #include <rmm/cuda_stream_view.hpp>
12 
13 #include <rapidsmpf/statistics.hpp>
14 
15 namespace rapidsmpf {
16 
36  public:
48  rmm::cuda_stream_view stream, std::shared_ptr<Statistics> statistics
49  );
50 
74  std::string const& name,
75  std::optional<std::string> stream_delay_name = std::nullopt
76  );
77 
92  static void cancel_inflight_timings(Statistics const* statistics);
93 
94  private:
95  std::uintptr_t uid_{0};
96  rmm::cuda_stream_view stream_;
97  std::shared_ptr<Statistics> statistics_;
98 };
99 
100 } // namespace rapidsmpf
Tracks statistics across rapidsmpf operations.
Definition: statistics.hpp:74
Stream-ordered wall-clock timer that records its result into Statistics.
void stop_and_record(std::string const &name, std::optional< std::string > stream_delay_name=std::nullopt)
Marks the stop position in the stream and schedules recording of the duration.
static void cancel_inflight_timings(Statistics const *statistics)
Cancel all in-flight timings associated with a Statistics object.
StreamOrderedTiming(rmm::cuda_stream_view stream, std::shared_ptr< Statistics > statistics)
Constructs a StreamOrderedTiming and marks the start position in the stream.
RAPIDS Multi-Processor interfaces.
Definition: backend.hpp:14