diff --git a/checkin_notes b/checkin_notes index e3f286dc83..7c774d89b5 100644 --- a/checkin_notes +++ b/checkin_notes @@ -202,3 +202,10 @@ David 5 Jan 2012 lib/ gui_rpc_client_ops.cpp + +Rom 3 Jan 2012 + - client: Restore scaling factor for AMD OpenCL devices on Macs with + OpenCL version < 1.2. + + client/ + coproc_detect.cpp diff --git a/client/coproc_detect.cpp b/client/coproc_detect.cpp index 34e867192a..1989a79d8f 100644 --- a/client/coproc_detect.cpp +++ b/client/coproc_detect.cpp @@ -293,6 +293,21 @@ void COPROCS::get_opencl( (strstr(prop.vendor, "Advanced Micro Devices, Inc.")) ) { prop.device_num = (int)(ati_opencls.size()); +#ifdef __APPLE__ + // Work around a bug in OpenCL which returns only + // 1/2 of total global RAM size. + // This bug applies only to ATI GPUs, not to NVIDIA + // This has already been fixed on latest Catalyst + // drivers, but Mac does not use Catalyst drivers. + // Assume this will be fixed in openCL 1.2. + // See also further workaround code for systems with + // CAL support. + if ((!strstr("1.0", prop.opencl_platform_version)) + || (!strstr("1.1", prop.opencl_platform_version)) + ){ + prop.global_mem_size *= 2; + } +#endif if (!ati.have_cal) { COPROC_ATI c; c.opencl_prop = prop; @@ -329,6 +344,7 @@ void COPROCS::get_opencl( // Work around a bug in OpenCL which returns only // 1/2 of total global RAM size: use the value from CAL. // This bug applies only to ATI GPUs, not to NVIDIA + // See also further workaround code for Macs. // ati.opencl_prop.global_mem_size = ati.attribs.localRAM * MEGA; } else {