From 1d3aa5129e179102b04d2175f5091444abd9ad5b Mon Sep 17 00:00:00 2001 From: Gil Pitney Date: Mon, 8 Dec 2014 18:59:34 -0800 Subject: Adjust CL_DEVICE_MAX_WORK_GROUP_SIZE and CL_DEVICE_MAX_WORK_ITEM_SIZES values. Some Khronos basic tests were crashing with huge work group sizes. This patch adjusts values down so that Khronos basic tests local_arg_def and local_kernel_def can now pass. Signed-off-by: Gil Pitney --- src/core/cpu/device.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/core/cpu/device.cpp b/src/core/cpu/device.cpp index e444deb..b0732ac 100644 --- a/src/core/cpu/device.cpp +++ b/src/core/cpu/device.cpp @@ -61,7 +61,9 @@ using namespace Coal; // unsigned arm_speed(); #endif -#define ONE_GIGABYTE (1 << 30) +#define ONE_MEGABYTE (1024 * 1024) +#define ONE_GIGABYTE (1024 * ONE_MEGABYTE) +#define HALF_GIGABYTE (512 * ONE_MEGABYTE) CPUDevice::CPUDevice() : DeviceInterface(), p_cores(0), p_num_events(0), p_workers(0), p_stop(false), @@ -375,14 +377,18 @@ cl_int CPUDevice::info(cl_device_info param_name, SIMPLE_ASSIGN(cl_uint, MAX_WORK_DIMS); break; + /*----------------------------------------------------------------- + * Set to a small enough size so that Khronos basic/local_kernel_def + * test can allocate and pass. + *----------------------------------------------------------------*/ case CL_DEVICE_MAX_WORK_GROUP_SIZE: - SIMPLE_ASSIGN(size_t, ONE_GIGABYTE); + SIMPLE_ASSIGN(size_t, 46*1024); break; case CL_DEVICE_MAX_WORK_ITEM_SIZES: for (int i=0; i