From 395648cfef20c8f4c653d714fc0b07cf847ee39e Mon Sep 17 00:00:00 2001 From: Starla Huang <82885378+starlahuang@users.noreply.github.com> Date: Tue, 18 Mar 2025 16:03:13 +0000 Subject: [PATCH] Use max work item size instead (#2294) The test is using CL_DEVICE_MAX_WORK_GROUP_SIZE as first dimension of local work size. But it can be bigger than the first dimension of CL_DEVICE_MAX_WORK_ITEM_SIZEs which results in failure. This patch corrects it to query and use the first dimension of CL_DEVICE_MAX_WORK_ITEM_SIZES instead. Signed-off-by: Xing Huang --- test_conformance/api/test_sub_group_dispatch.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test_conformance/api/test_sub_group_dispatch.cpp b/test_conformance/api/test_sub_group_dispatch.cpp index fb0401cf..70a78f4a 100644 --- a/test_conformance/api/test_sub_group_dispatch.cpp +++ b/test_conformance/api/test_sub_group_dispatch.cpp @@ -102,10 +102,13 @@ REGISTER_TEST_VERSION(sub_group_dispatch, Version(2, 1)) out = clCreateBuffer(context, CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, sizeof(size_t), NULL, &error); test_error(error, "clCreateBuffer failed"); - error = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZE, - sizeof(size_t), &max_local, NULL); + size_t max_work_item_sizes[3] = {}; + error = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, + sizeof(max_work_item_sizes), &max_work_item_sizes, + nullptr); test_error(error, "clGetDeviceInfo failed"); + max_local = max_work_item_sizes[0]; error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, sizeof(platform), (void *)&platform, NULL);