Thank you for bringing this to our attention. I have checked in a fix for the sizeof() bug, and added comments about not needing a match for "ATI". (The same point applies to "NVIDIA", by the way)
Regarding the question of whether we should return CL_INVALID_DEVICE_TYPE if the vendor does not match any of our expected values, I think it is better to leave it as is, returning 0, as this might allow the existing code to work for future GPU vendors. If the vendor does not match the requested / expected one, then boinc_get_opencl_ids_aux() already does return CL_INVALID_DEVICE_TYPE. Cheers, --Charlie -- Charlie Fenton [email protected] BOINC / SETI@home Macintosh & Windows Programmer Space Sciences Laboratory UC Berkeley On Jan 10, 2013, at 10:51 AM, Heinz-Bernd Eggenstein wrote: > Hi all! > > Someone familiar with BOINC's OpenCL code should have a look at the > attached patch. > > 1) It corrects one clear bug (use of sizeof() on a pointer var to get the > length of the array pointed to...doesn't work). > > 2) There is another more subtle point that needs checking. > In the original form, get_vendor() returns the Vendor string supplied > by the openCL API call in case > none of the conditions that are used to detect AMD, NVIDIA, and INTEL > GPUs matches. > In most cases (say, vendor ="Acme"), this will cause problems in the > calling code because, as I understand it, > get_vendor() should translate native vendor names to standard > "canonical" names used by BOINC. So I think the intended > behavior was to return CL_INVALID_DEVICE_TYPE in this case and this is > another bug. > > However, if the openCL API returns "ATI" (for legacy cards/drivers > ????), this would actually happen to work because > it coincides with the canonical vendor name used by BOINC for ATI/AMD > GPUs, even tho the original > code doesn't try to match "ATI". > > The enclosed patch deals with this by adding an explicit match with > "ATI" and > otherwise returning an error if no match is found with known vendor > name patterns. > > OK? > > Cheers > HB _______________________________________________ boinc_dev mailing list [email protected] http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev To unsubscribe, visit the above URL and (near bottom of page) enter your email address.
