Files
d4r/tools/d4r_event_wait.h
T
ayo 7c5d3c9157 feat: add d4r inference engines and Windows parity tooling
Add native K/M/RR inference engines, HIP kernels, replay and validation
harnesses, and Windows DLSS setup and runtime support. Include GPU
profiling tools, build and packaging scripts, platform integration
patches, and implementation documentation.
2026-10-16 08:54:47 -04:00

17 lines
435 B
C++

#pragma once
// Query completion rather than trusting HIP event flags to put the CPU to
// sleep. Never treat NOT_READY as completion, including during retirement.
template <typename Query, typename Sleep>
int d4r_wait_event(Query query, Sleep sleep)
{
constexpr int cudaNotReady = 600;
for (;;)
{
const int result = query();
if (result != cudaNotReady)
return result;
sleep();
}
}