OpenCL Header only Dynamically Opened ICD Loader Proposal#169
OpenCL Header only Dynamically Opened ICD Loader Proposal#169Kerilk wants to merge 4 commits intoKhronosGroup:mainfrom
Conversation
|
Cool! This looks like a mix between the previous Static Lib with Dynamic Loader and ICD Loader Header File proposals. Having working code to play around with and demonstrate that it works is awesome. Out of curiousity are you generating these files, or did you author them manually? I think it should be possible to generate most of them. I think we mostly need to figure out which solution (or solutions, this doesn't need to be one-size-fits-all) we want and then start adding them to the SDK / CI / etc. There are clearly lots of different options, with different pros and cons. Note that there are some aspects of this PR that we may want to adopt regardless, for example it looks like we both added some sort of a define to control linkage in the header file - see |
Thanks, I didn't knew about those (only about your presentation, I didn't find pointer to code in it), I will need to study them, they look great.
I did not generate them yet because I wanted to do a full pass on the headers to be sure not to miss something. There are some strange inconsistencies:
Yes, hopefully this one will help accomplish this goal. For this work there is some thread safety involved, so maybe using it to run the conformance test may be better (though I don't know how much parallel testing the conformance tests do). We also need some way to be able to install a working driver on windows image in GitHub actions. Ubuntu is easy, MacOS can work (with reservations), but for now I don't have a solution for windows...
I agree with you completely. I started with a slighly more complex proposal initially that allowed even more flexibility, by having non static inline functions with extern declarations in the library. And you could switch between |
This is a (full fledged, functional) straw-man proposal of an implementation of one of @bashbaug ideas for easing OpenCL ICD loader issues. These headers allow an OpenCL application to be built normally or with the
-DOPENCL_LOADflag active. In this case, linking with the loader is not necessary anymore as it is opened dynamically.The title is slightly misleading as ONE source file from the project must also include the
CL/opencl_load_lib.hto have a single definitions of the global variables used. (on windows this could go away as on MSVCinlinefunctions can declare non const static variables).This allows:
This does not allow an application to:
The last point could be fixed using indirect dispatch in the loader.
I will add CI tests for it.