sc/source/core/opencl/opencl_device_selection.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
New commits: commit 03d90274bcb6fb617034161c6d4676050d7e9edb Author: Tor Lillqvist <t...@collabora.com> Date: Thu Oct 30 22:47:26 2014 +0200 Make sure the cached OpenCL profile file actually matches the devices present Re-evaluate scores if the profile file did not match. It used to work so that if the OpenCL devices available had changed (if just the OpenCL driver version had changed), we did not re-evaluate scores but instead selected the dummy software device. Which hardly was as intended. Change-Id: Ifd79c0226504323f275d2e1d02876a0fecc449e0 diff --git a/sc/source/core/opencl/opencl_device_selection.h b/sc/source/core/opencl/opencl_device_selection.h index 1d5086d..fcfa41a 100644 --- a/sc/source/core/opencl/opencl_device_selection.h +++ b/sc/source/core/opencl/opencl_device_selection.h @@ -602,7 +602,17 @@ inline ds_status readProfileFromFile(ds_profile* profile, ds_score_deserializer } cleanup: if (contentStart != NULL) free(contentStart); - return status; + if (status != DS_SUCCESS) + return status; + + // Check that all the devices present had valid cached scores. If + // not, return DS_INVALID_PROFILE and let the caller re-evaluate + // scores for present devices, and write a new profile file. + for (unsigned int i = 0; i < profile->numDevices; i++) + if (profile->devices[i].score == NULL) + return DS_INVALID_PROFILE; + + return DS_SUCCESS; } inline ds_status getNumDeviceWithEmptyScore(ds_profile* profile, unsigned int* num) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits