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 
35  public:
46  rmm::cuda_stream_view stream, std::shared_ptr<Statistics> statistics
47  );
48 
72  std::string const& name,
73  std::optional<std::string> stream_delay_name = std::nullopt
74  );
75 
90  static void cancel_inflight_timings(Statistics const* statistics);
91 
92  private:
93  std::uintptr_t uid_{0};
94  rmm::cuda_stream_view stream_;
95  std::shared_ptr<Statistics> statistics_;
96 };
97 
98 } // namespace rapidsmpf
Tracks statistics across rapidsmpf operations.
Definition: statistics.hpp:71
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