offline build

Hello everyone,
For my experience, the online build in OpenCL is very time-consuming.Well,how to use the offline build?I found the API “clCreateProgramWithBinary”, but how can I get the binary ?Any ideas?
Thanks in advance.

I was wondering about the same question on this thread. However, shortly afterward this thread appeared, answering the question. So it seems you would have to build a small compiler program that would use clCreateProgramWithSource(), and then use clGetProgramInfo() to get to the PTX code strings, that you could then save to a file. Then, in your main program, you would load this file into the memory, and use clCreateProgramWithBinaries(). Haven’t tried all of this by myself, though, so I don’t know how much of the compilation speed improvement one would expect.

In any case, it would be great if this kind of compiler program provided within the SDK. As I mentioned in the thread referenced above, AMD SDK is containing it.

Thanks a lot.

I also found an useful API " oclLogPtx()" in NV SDK that can get and log the binary (PTX) from the OpenCL compiler.

For my testing on Windows, the offline build is nearly 4 times faster than online build.