Skip to content

Commit 1eaedce

Browse files
authored
[SYCL][UR][L0 v2] Add missing check to urQueueCreateWithNativeHandle (#19569)
V2 only supports creating queue from immediate command lists.
1 parent c01b093 commit 1eaedce

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

unified-runtime/source/adapters/level_zero/v2/queue_create.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,19 @@ ur_result_t urQueueCreateWithNativeHandle(
109109
}
110110
}
111111

112+
ze_bool_t isImmediate = false;
113+
ZE2UR_CALL(
114+
zeCommandListIsImmediate,
115+
(reinterpret_cast<ze_command_list_handle_t>(hNativeQueue), &isImmediate));
116+
117+
if (!isImmediate) {
118+
UR_LOG(ERR, "urQueueCreateWithNativeHandle: "
119+
"Native handle is not an immediate command "
120+
"list; only immediate command lists are "
121+
"supported.");
122+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
123+
}
124+
112125
auto commandListHandle = v2::raii::command_list_unique_handle(
113126
reinterpret_cast<ze_command_list_handle_t>(hNativeQueue),
114127
[ownNativeHandle](ze_command_list_handle_t hZeCommandList) {

0 commit comments

Comments
 (0)