From aed729dbcd69082c4143901184d53d0551623f7b Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Fri, 17 Feb 2012 00:31:14 +0000 Subject: [PATCH] client: Always use GPU model name from OpenCL if available for ATI / AMD GPUs svn path=/trunk/boinc/; revision=25276 --- client/coproc_detect.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/client/coproc_detect.cpp b/client/coproc_detect.cpp index 58ab71f8f7..b69e507d4d 100644 --- a/client/coproc_detect.cpp +++ b/client/coproc_detect.cpp @@ -429,10 +429,19 @@ strcpy(prop.opencl_driver_version, "CLH 1.0"); #endif if (ati.have_cal) { - // Always use GPU model name from OpenCL if available for ATI / AMD - // GPUs because (we believe) it is more reliable and user-friendly. - // Assumes OpenCL and CAL return the devices in the same order - strcpy(ati_gpus[prop.device_num].name, prop.name); + if (prop.device_num < (int)(ati_gpus.size())) { + // Always use GPU model name from OpenCL if available for ATI / AMD + // GPUs because (we believe) it is more reliable and user-friendly. + // Assumes OpenCL and CAL return the devices in the same order + strcpy(ati_gpus[prop.device_num].name, prop.name); + } else { + if (log_flags.coproc_debug) { + msg_printf(0, MSG_INFO, + "[coproc] OpenCL ATI device #%d does not match any CAL device", + device_index + ); + } + } } else { COPROC_ATI c; c.opencl_prop = prop;