Skip to content

Commit 03f7779

Browse files
authored
fix clEnqueueNDRangeKernel for NULL work_global_size (#760)
According to the OpenCL specification, work_dim can be 0 and work_global_size can be NULL. KhronosGroup/OpenCL-CTS#2240
1 parent a58a077 commit 03f7779

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/api.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4080,6 +4080,11 @@ cl_int CLVK_API_CALL clEnqueueNDRangeKernel(
40804080
command_queue, kernel, work_dim, num_events_in_wait_list,
40814081
event_wait_list, event);
40824082

4083+
static const size_t null_global_work_size[3] = {0};
4084+
if (global_work_size == nullptr) {
4085+
global_work_size = null_global_work_size;
4086+
}
4087+
40834088
cvk_ndrange ndrange(work_dim, global_work_offset, global_work_size,
40844089
local_work_size);
40854090

0 commit comments

Comments
 (0)