From 34e47322db205d3c8c972ddebbf51bb4122e45f5 Mon Sep 17 00:00:00 2001 From: "Senran (Stephen) Zhang" Date: Tue, 7 Sep 2021 00:14:36 +0800 Subject: [PATCH] Limit workgroup size for atomics tests (#1197) * Limit workgroup size for atomics tests This avoids extremely large local buffer size and slow run * Always limit workgroup size --- test_conformance/atomics/test_atomics.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test_conformance/atomics/test_atomics.cpp b/test_conformance/atomics/test_atomics.cpp index 34b34ed3..c0c01363 100644 --- a/test_conformance/atomics/test_atomics.cpp +++ b/test_conformance/atomics/test_atomics.cpp @@ -200,6 +200,10 @@ int test_atomic_function(cl_device_id deviceID, cl_context context, cl_command_q error = clGetKernelWorkGroupInfo( kernel, deviceID, CL_KERNEL_WORK_GROUP_SIZE, sizeof( workSize ), &workSize, NULL ); test_error( error, "Unable to obtain max work group size for device and kernel combo" ); + // Limit workSize to avoid extremely large local buffer size and slow + // run. + if (workSize > 65536) workSize = 65536; + // "workSize" is limited to that of the first dimension as only a 1DRange is executed. if( maxSizes[0] < workSize ) {