Skip to content

Commit b5f7e0e

Browse files
committed
[L0 v2] implement UR_QUEUE_INFO_EMPTY query
1 parent 3507f8d commit b5f7e0e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

source/adapters/level_zero/v2/queue_immediate_in_order.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,15 @@ ur_queue_immediate_in_order_t::queueGetInfo(ur_queue_info_t propName,
132132
case UR_QUEUE_INFO_DEVICE_DEFAULT:
133133
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
134134
case UR_QUEUE_INFO_EMPTY: {
135-
// We can't tell if the queue is empty as we don't hold to any events
136-
return ReturnValue(false);
135+
auto status = ZE_CALL_NOCHECK(zeCommandListHostSynchronize,
136+
(handler.commandList.get(), 0));
137+
if (status == ZE_RESULT_SUCCESS) {
138+
return ReturnValue(true);
139+
} else if (status == ZE_RESULT_NOT_READY) {
140+
return ReturnValue(false);
141+
} else {
142+
return ze2urResult(status);
143+
}
137144
}
138145
default:
139146
logger::error("Unsupported ParamName in urQueueGetInfo: "

0 commit comments

Comments
 (0)