Compilation of the Kernel is always at runtime?
In my application, in a certain problem the time of kernel compilation is eighty percent of the time of all execution.
And, some references say that compilation of kernel is always in runtime of application. So, every time that i execute my application, the kernel is compiled.
There some ways that i compile my kernel a only time?
Re: Compilation of the Kernel is always at runtime?
Yes, there is a very simple way. After building your program with clBuildProgram() you can retrieve the prebuilt program binary with clGetProgramInfo(..., CL_PROGRAM_BINARIES, ...)
Next time your program runs, you can use that precompiled binary and load it with clCreateProgramWithBinary() instead of using clCreateProgramWithSource(). It should be quite a bit faster than recompiling from source.