Skip to content

Commit 20844dd

Browse files
authored
Merge pull request #1807 from igchor/kernel_enqueue_check_wg
[L0] Add missing check for WorkDim to KernelLaunch funcs
2 parents 06d0c05 + a04ee7e commit 20844dd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/adapters/level_zero/kernel.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@ ur_result_t ur_queue_handle_legacy_t_::enqueueKernelLaunch(
130130
*OutEvent ///< [in,out][optional] return an event object that identifies
131131
///< this particular kernel execution instance.
132132
) {
133-
auto Queue = this;
133+
UR_ASSERT(WorkDim > 0, UR_RESULT_ERROR_INVALID_WORK_DIMENSION);
134+
UR_ASSERT(WorkDim < 4, UR_RESULT_ERROR_INVALID_WORK_DIMENSION);
134135

136+
auto Queue = this;
135137
ze_kernel_handle_t ZeKernel{};
136138
UR_CALL(getZeKernel(Queue, Kernel, &ZeKernel));
137139

@@ -337,6 +339,9 @@ ur_result_t ur_queue_handle_legacy_t_::enqueueCooperativeKernelLaunchExp(
337339
*OutEvent ///< [in,out][optional] return an event object that identifies
338340
///< this particular kernel execution instance.
339341
) {
342+
UR_ASSERT(WorkDim > 0, UR_RESULT_ERROR_INVALID_WORK_DIMENSION);
343+
UR_ASSERT(WorkDim < 4, UR_RESULT_ERROR_INVALID_WORK_DIMENSION);
344+
340345
auto Queue = this;
341346
auto ZeDevice = Queue->Device->ZeDevice;
342347

0 commit comments

Comments
 (0)