mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
ircd:🆑 Allow null handle for no-wait completion.
This commit is contained in:
parent
97f3f232ca
commit
5f7fff3646
1 changed files with 7 additions and 5 deletions
12
ircd/cl.cc
12
ircd/cl.cc
|
@ -2410,13 +2410,15 @@ ircd::cl::work::wait(const uint desired)
|
|||
try
|
||||
{
|
||||
static_assert(CL_COMPLETE == 0);
|
||||
assert(handle);
|
||||
constexpr auto execution_status
|
||||
{
|
||||
CL_EVENT_COMMAND_EXECUTION_STATUS
|
||||
};
|
||||
|
||||
char buf[4];
|
||||
int status
|
||||
{
|
||||
info<int>(clGetEventInfo, cl_event(handle), CL_EVENT_COMMAND_EXECUTION_STATUS, buf)
|
||||
};
|
||||
int status {0};
|
||||
if(likely(handle))
|
||||
status = info<int>(clGetEventInfo, cl_event(handle), execution_status, buf);
|
||||
|
||||
if(status > int(desired))
|
||||
status = wait_event(*this, status, desired);
|
||||
|
|
Loading…
Reference in a new issue