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.
17 lines
435 B
C++
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();
|
|
}
|
|
}
|