From fcc88842b58b43407d7f7102ed8c61311b2d1afc Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Fri, 24 Jan 2025 11:00:34 +0100 Subject: [PATCH] fix clEnqueueNDRangeKernel for NULL work_global_size According to the OpenCL specification, work_dim can be 0 and work_global_size can be NULL. In those cases, the behavior is the same as a enqueued marker. https://github.com/KhronosGroup/OpenCL-CTS/issues/2240 --- src/api.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/api.cpp b/src/api.cpp index e60d63fd..9f4e5f5a 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -4064,6 +4064,12 @@ cl_int CLVK_API_CALL clEnqueueNDRangeKernel( command_queue, kernel, work_dim, num_events_in_wait_list, event_wait_list, event); + if (work_dim == 0 || global_work_size == nullptr) { + return cvk_enqueue_marker_with_wait_list(icd_downcast(command_queue), + num_events_in_wait_list, + event_wait_list, event); + } + cvk_ndrange ndrange(work_dim, global_work_offset, global_work_size, local_work_size);