mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Test that queues are flushed by clReleaseCommandQueue (#923)
... as required by the OpenCL specification. Also introduce a utility function to manage polling for changes via a user-supplied function. Several tests we introduced lately could have used this. Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
@@ -1693,3 +1693,23 @@ Version get_max_OpenCL_C_for_context(cl_context context)
|
||||
});
|
||||
return current_version;
|
||||
}
|
||||
|
||||
bool poll_until(unsigned timeout_ms, unsigned interval_ms,
|
||||
std::function<bool()> fn)
|
||||
{
|
||||
unsigned time_spent_ms = 0;
|
||||
bool ret = false;
|
||||
|
||||
while (time_spent_ms < timeout_ms)
|
||||
{
|
||||
ret = fn();
|
||||
if (ret)
|
||||
{
|
||||
break;
|
||||
}
|
||||
usleep(interval_ms * 1000);
|
||||
time_spent_ms += interval_ms;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user