I think you can use clGetProgramInfo (cl_program program, cl_program_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret) with CL_PROGRAM_BINARIES as param_name to get the program binaries.
It return the program binaries of all devices associated with program. you can save those binaries as a '.clo' file and use it to create program by clCreateProgramWithBinary .
You can read the code of AMD APP SDK Samples.There are many of such operations.
Thank you very much for your kind answer.
But the binary file generated by function clGetProgramInfo is in binary code flow and I cannot modify the code.
Could it show in the form of il or assembly?
1 of 1 people found this helpful
Use the compilation option -fbin-amdil to store the IL in the binary.
Many thanks for your answer.
But where could I add the option " -fbin-amdil "？I use Visual Studio 2008
on Windows7， and I add the option in the code like one optimization option
such as "-cl-fast-relaxed-math" but I find it does not work.
I am looking forward to your reply.
在 2012年4月13日 下午10:58，MicahVillmow <email@example.com>写道：
AMD Developer Forums <http://devgurus.amd.com/index.jspa>
Re: Whether the OpenCL supports binary file on AMD Cards? in OpenCL