0
0
Fork 0
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:
Jason Volk 2022-03-05 12:44:06 -08:00
parent 97f3f232ca
commit 5f7fff3646

View file

@ -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);