Understanding OpenCL IL and GPU ISA layers

Still in process of learning basics of OpenCL. Trying to understand what happens to OpenCL code after compiling OpenCL C and executing on GPU device.
This seems to be an area which is not discussed in detail in many of the available OpenCL books, usually only a couple terse sentences from one HW vendor perspective, whomever sponsored the book, usually AMD…

Prior to OpenCL 2.x (or when??) it appears LLVM was the intermediate language which OpenCL C got compiled down to “first”.
Then, depending on the specific vendor HW driver (ICD?) perhaps it is converted into yet another IL, … AMD-IL or NV PTX?.. (what all flavors/varieties of IL are possible/exist here?), before finally it gets converted into device/generation-specific ISA?
Now (OpenCL 2.1 and later?) Khronos SPIR-V is the native IL that OpenCL C gets compile into?

Is this type of stuff clearly explained/documented anywhere?
Thanks, Colin

The most comprehensive way to learn what a driver does under the hood would be to read a driver source code, i.e. Mesa. Also: http://developer.amd.com/resources/developer-guides-manuals/ (scroll down till the end).

Then, depending on the specific vendor HW driver (ICD?) perhaps it is converted into yet another IL, … AMD-IL or NV PTX?.. (what all flavors/varieties of IL are possible/exist here?), before finally it gets converted into device/generation-specific ISA?

It just makes sence they’d do that, yes.

Cool, thanks. I’ll have a look at the driver code.