Binary Caching Supported?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Binary Caching Supported?

suleman
Hi,

Does jocl supports binary caching (caching the program binaries after the first run). Or it compiles the kernel every time the program is executed. If this is the case then i have to use the binary file to buil the program.

many thanks.



Reply | Threaded
Open this post in threaded view
|

Re: Binary Caching Supported?

Michael Bien
  you can safe compiled programs to file. Take a look at the
CLProgramBuilder API.

one possible entry point is:
CLProgramConfiguration config = program.prepare();

now you can serialise the config into arbitrary streams via
config.safe(...). This will include the complete CLBuildConfiguration
like compiler options, target devices and preprocessor state. If the
program has been built before serialization it will also include the
binaries.

to deserialize programs:
CLProgramConfiguration config =
CLProgramBuilder.loadConfiguration(stream, context)

take a look at the CLProgramTest junit tests for full roundtrips.

best regards,
michael

On 04/19/2011 12:40 PM, suleman [via jogamp] wrote:
>
> Hi,
>
> Does jocl supports binary caching (caching the program binaries after the
> first run). Or it compiles the kernel every time the program is executed. If
> this is the case then i have to use the binary file to buil the program.
>
> many thanks.
>