Kaydet (Commit) 03d90274 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst 07accd02
...@@ -602,7 +602,17 @@ inline ds_status readProfileFromFile(ds_profile* profile, ds_score_deserializer ...@@ -602,7 +602,17 @@ inline ds_status readProfileFromFile(ds_profile* profile, ds_score_deserializer
} }
cleanup: cleanup:
if (contentStart != NULL) free(contentStart); 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) inline ds_status getNumDeviceWithEmptyScore(ds_profile* profile, unsigned int* num)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment