TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
tmk::gpu::DeviceBackOff Class Reference

#include <gpu/backoff.hpp>

Public Member Functions

bool waiting (std::int64_t now_ms) const
 True while a refusal is recent enough that the device should not be asked.
void refused (std::int64_t now_ms)
 The device refused (not enough free memory, or allocation failed): wait, twice as long as last time.
void accepted ()
 The device took work again: the next refusal starts from the first delay.
std::int64_t next_delay_ms () const
 Delay a refusal at this point would set (for tests and logs).

Static Public Attributes

static constexpr std::int64_t kFirstMs = 30'000
static constexpr std::int64_t kMaxMs = 900'000

Detailed Description

Definition at line 16 of file backoff.hpp.

Member Function Documentation

◆ accepted()

void tmk::gpu::DeviceBackOff::accepted ( )
inline

The device took work again: the next refusal starts from the first delay.

Definition at line 31 of file backoff.hpp.

◆ next_delay_ms()

std::int64_t tmk::gpu::DeviceBackOff::next_delay_ms ( ) const
inline

Delay a refusal at this point would set (for tests and logs).

Definition at line 34 of file backoff.hpp.

◆ refused()

void tmk::gpu::DeviceBackOff::refused ( std::int64_t now_ms)
inline

The device refused (not enough free memory, or allocation failed): wait, twice as long as last time.

Definition at line 24 of file backoff.hpp.

◆ waiting()

bool tmk::gpu::DeviceBackOff::waiting ( std::int64_t now_ms) const
inline

True while a refusal is recent enough that the device should not be asked.

Definition at line 21 of file backoff.hpp.

Member Data Documentation

◆ kFirstMs

std::int64_t tmk::gpu::DeviceBackOff::kFirstMs = 30'000
staticconstexpr

Definition at line 18 of file backoff.hpp.

◆ kMaxMs

std::int64_t tmk::gpu::DeviceBackOff::kMaxMs = 900'000
static

Definition at line 18 of file backoff.hpp.


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