[Suggestion]Precompilation tool

Any chance to create a tool to precompile our OpenCL kernels for ALL the NVIDIA’s devices, pls?
Something like the tool included in the Intel’s OpenCL SDK:

Important: it must be able to compile for ALL the NVIDIA devices(G80,GT200,Femi), so I’ll just need to save the result to a file and pass it to clBuildProgramFromBinaries() when a NVIDIA OpenCL device is detected.

This has three main advantages over using the source code:

  1. It hides better our IP because we won’t need to supply the kernels’s source code.
  2. Kernels will compile much faster than if they’re JIT-compiled.
  3. We could see the generated code and to search for optimizations or bugs.

I personally think every IHV supporting OpenCL precompiled kernels should provide a tool as this one.

You can call clGetProgramInfo() with CL_PROGRAM_BINARIES to get the PTX assembler source code on NVIDIA, which I suppose you can pass to clCreateProgramWithBinary() again (I haven’t tried it). That PTX code still should be pretty generic. Also see the topic clcc - an NVIDIA OpenCL command line compiler where ljbadenz is speculating whether clCreateProgramWithBinary() would also accept precompiled cubin in addition to PTX.

Yep, but that probably requires to install the GPU you want to precompile the kernels for… and I need ALL the NVIDIA’s devices to be precompiled ( or a custom list ).

ATI added the “cl_amd_offline_devices” platform extension for that but, ideally, I would prefer some kind of visual tool.

Intel’s tool is much easier to use and effective. I would want a NVIDIA’s equivalent.

Btw, would be a good idea to make it portable to other OSs ( so use Qt or similar, etc… )