Skip to content

Commit 7179e83

Browse files
[SYCL] Follow-up for #7599 - return PI_ERROR_INVALID_VALUE after assert (#7764)
1 parent 4ab9bf2 commit 7179e83

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

sycl/plugins/cuda/pi_cuda.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -2534,9 +2534,13 @@ pi_result cuda_piextQueueCreate(pi_context Context, pi_device Device,
25342534
assert(Properties);
25352535
// Expect flags mask to be passed first.
25362536
assert(Properties[0] == PI_QUEUE_FLAGS);
2537+
if (Properties[0] != PI_QUEUE_FLAGS)
2538+
return PI_ERROR_INVALID_VALUE;
25372539
pi_queue_properties Flags = Properties[1];
25382540
// Extra data isn't supported yet.
25392541
assert(Properties[2] == 0);
2542+
if (Properties[2] != 0)
2543+
return PI_ERROR_INVALID_VALUE;
25402544
return cuda_piQueueCreate(Context, Device, Flags, Queue);
25412545
}
25422546

sycl/plugins/esimd_emulator/pi_esimd_emulator.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -930,9 +930,13 @@ pi_result piextQueueCreate(pi_context Context, pi_device Device,
930930
assert(Properties);
931931
// Expect flags mask to be passed first.
932932
assert(Properties[0] == PI_QUEUE_FLAGS);
933+
if (Properties[0] != PI_QUEUE_FLAGS)
934+
return PI_ERROR_INVALID_VALUE;
933935
pi_queue_properties Flags = Properties[1];
934936
// Extra data isn't supported yet.
935937
assert(Properties[2] == 0);
938+
if (Properties[2] != 0)
939+
return PI_ERROR_INVALID_VALUE;
936940
return piQueueCreate(Context, Device, Flags, Queue);
937941
}
938942
pi_result piQueueCreate(pi_context Context, pi_device Device,

sycl/plugins/hip/pi_hip.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -2411,9 +2411,13 @@ pi_result hip_piextQueueCreate(pi_context Context, pi_device Device,
24112411
assert(Properties);
24122412
// Expect flags mask to be passed first.
24132413
assert(Properties[0] == PI_QUEUE_FLAGS);
2414+
if (Properties[0] != PI_QUEUE_FLAGS)
2415+
return PI_ERROR_INVALID_VALUE;
24142416
pi_queue_properties Flags = Properties[1];
24152417
// Extra data isn't supported yet.
24162418
assert(Properties[2] == 0);
2419+
if (Properties[2] != 0)
2420+
return PI_ERROR_INVALID_VALUE;
24172421
return hip_piQueueCreate(Context, Device, Flags, Queue);
24182422
}
24192423

sycl/plugins/opencl/pi_opencl.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,13 @@ pi_result piextQueueCreate(pi_context Context, pi_device Device,
471471
assert(Properties);
472472
// Expect flags mask to be passed first.
473473
assert(Properties[0] == PI_QUEUE_FLAGS);
474+
if (Properties[0] != PI_QUEUE_FLAGS)
475+
return PI_ERROR_INVALID_VALUE;
474476
pi_queue_properties Flags = Properties[1];
475477
// Extra data isn't supported yet.
476478
assert(Properties[2] == 0);
479+
if (Properties[2] != 0)
480+
return PI_ERROR_INVALID_VALUE;
477481
return piQueueCreate(Context, Device, Flags, Queue);
478482
}
479483
pi_result piQueueCreate(pi_context context, pi_device device,

0 commit comments

Comments
 (0)