OCL-dev / ocl-icd

OpenCL ICD Loader (free software)
BSD 2-Clause "Simplified" License
76 stars 23 forks source link

Platform sorting doesn't play well with some interceptors #14

Closed kpet closed 4 years ago

kpet commented 4 years ago

The platform sorting feature calls clGetDeviceIDs directly relying on the dispatch table to call into the appropriate platform. This doesn't always play well with interceptors that need clGetPlatformIDs to return before clGetDeviceIDs can be called. Using explicit pointers for clGetDeviceIDs instead of relying on the dispatch table would solve this issue.

Kerilk commented 4 years ago

Thanks for the nice catch. I pushed a fix, tell me how it goes.

kpet commented 4 years ago

This seems to have done the trick. Thanks for the quick fix! :) BTW, you may want to create a new tag (the last one is from 2017) so this makes it into distributions (I found this issue because my distribution hasn't transitioned to the official loader yet).