Skip to content

Commit 01be8b8

Browse files
committed
[L0 v2] check if device is valid in queueCreate
to match specification
1 parent 7236161 commit 01be8b8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

source/adapters/level_zero/v2/queue_create.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ ur_result_t urQueueCreate(ur_context_handle_t hContext,
2222
ur_device_handle_t hDevice,
2323
const ur_queue_properties_t *pProperties,
2424
ur_queue_handle_t *phQueue) {
25+
if (!hContext->isValidDevice(hDevice)) {
26+
return UR_RESULT_ERROR_INVALID_DEVICE;
27+
}
28+
2529
// TODO: For now, always use immediate, in-order
2630
*phQueue =
2731
new v2::ur_queue_immediate_in_order_t(hContext, hDevice, pProperties);

0 commit comments

Comments
 (0)