33#ifndef GKO_PUBLIC_CORE_BASE_TIMER_HPP_
34#define GKO_PUBLIC_CORE_BASE_TIMER_HPP_
40#include <ginkgo/core/base/executor.hpp>
85 GKO_HIP_EVENT_STRUCT* hip_event;
86 sycl::event* dpcpp_event;
87 std::chrono::steady_clock::time_point chrono;
111 virtual ~Timer() =
default;
166 std::shared_ptr<const Executor> exec);
199 CudaTimer(std::shared_ptr<const CudaExecutor> exec);
205 std::shared_ptr<const CudaExecutor> exec_;
219 HipTimer(std::shared_ptr<const HipExecutor> exec);
225 std::shared_ptr<const HipExecutor> exec_;
239 DpcppTimer(std::shared_ptr<const DpcppExecutor> exec);
245 std::shared_ptr<const DpcppExecutor> exec_;
A timer using std::chrono::steady_clock for timing.
Definition timer.hpp:175
std::chrono::nanoseconds difference_async(const time_point &start, const time_point &stop) override
Computes the difference between the two time points in nanoseconds.
void wait(time_point &time) override
Waits until all kernels in-process when recording the time point are finished.
void record(time_point &time) override
Records a time point at the current time.
A timer using events for timing on a CudaExecutor.
Definition timer.hpp:190
void wait(time_point &time) override
Waits until all kernels in-process when recording the time point are finished.
std::chrono::nanoseconds difference_async(const time_point &start, const time_point &stop) override
Computes the difference between the two time points in nanoseconds.
void record(time_point &time) override
Records a time point at the current time.
A timer using kernels for timing on a DpcppExecutor in profiling mode.
Definition timer.hpp:230
void record(time_point &time) override
Records a time point at the current time.
std::chrono::nanoseconds difference_async(const time_point &start, const time_point &stop) override
Computes the difference between the two time points in nanoseconds.
void wait(time_point &time) override
Waits until all kernels in-process when recording the time point are finished.
A timer using events for timing on a HipExecutor.
Definition timer.hpp:210
void wait(time_point &time) override
Waits until all kernels in-process when recording the time point are finished.
std::chrono::nanoseconds difference_async(const time_point &start, const time_point &stop) override
Computes the difference between the two time points in nanoseconds.
void record(time_point &time) override
Records a time point at the current time.
Represents a generic timer that can be used to record time points and measure time differences on hos...
Definition timer.hpp:109
std::chrono::nanoseconds difference(time_point &start, time_point &stop)
Computes the difference between the two time points in nanoseconds.
time_point create_time_point()
Returns a newly created time point.
virtual void wait(time_point &time)=0
Waits until all kernels in-process when recording the time point are finished.
static std::unique_ptr< Timer > create_for_executor(std::shared_ptr< const Executor > exec)
Creates the timer type most suitable for recording accurate timings of kernels on the given executor.
virtual std::chrono::nanoseconds difference_async(const time_point &start, const time_point &stop)=0
Computes the difference between the two time points in nanoseconds.
virtual void record(time_point &time)=0
Records a time point at the current time.
An opaque wrapper for a time point generated by a timer.
Definition timer.hpp:49
The Ginkgo namespace.
Definition abstract_factory.hpp:48
constexpr T one()
Returns the multiplicative identity for T.
Definition math.hpp:803