Ginkgo: gko::CpuTimer Class Reference

| Ginkgo Generated from branch based on main. Ginkgo version 1.11.0 A numerical linear algebra library targeting many-core architectures

Loading...
Searching...
No Matches
gko::CpuTimer Class Reference

A timer using std::chrono::steady_clock for timing. More...

`#include <ginkgo/core/base/timer.hpp>`

Inheritance diagram for gko::CpuTimer:
[legend]
Collaboration diagram for gko::CpuTimer:
[legend]

## Public Member Functions
void | record (time_point &time) override
| Records a time point at the current time.
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.
Public Member Functions inherited from gko::Timer
time_point | create_time_point ()
| Returns a newly created time point.
std::chrono::nanoseconds | difference (time_point &start, time_point &stop)
| Computes the difference between the two time points in nanoseconds.

## Additional Inherited Members
Static Public Member Functions inherited from gko::Timer
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.

## Detailed Description

A timer using std::chrono::steady_clock for timing.

## Member Function Documentation

## ◆ difference_async()

std::chrono::nanoseconds gko::CpuTimer::difference_async | ( | const time_point & | start,
|  | const time_point & | stop )
| overridevirtual

Computes the difference between the two time points in nanoseconds.

This asynchronous version does not synchronize itself, so the time points need to have been synchronized with, i.e. timer->wait(stop) needs to have been called. The version is intended for more advanced users who want to measure the overhead of timing functionality separately.

Parameters

  start | the first time point (earlier)
  end | the second time point (later)

Returns
  the difference between the time points in nanoseconds.

Implements gko::Timer.

## ◆ record()

void gko::CpuTimer::record | ( | time_point & | time | ) |
| overridevirtual

Records a time point at the current time.

Implements gko::Timer.

## ◆ wait()

void gko::CpuTimer::wait | ( | time_point & | time | ) |
| overridevirtual

Waits until all kernels in-process when recording the time point are finished.

Implements gko::Timer.

The documentation for this class was generated from the following file:

- ginkgo/core/base/timer.hpp