In online compilation of OpenCl, we have to do...
program = clCreateProgramWithSource(context, 1, (const char **)&source_str, (const size_t *)&source_size, &ret);
But, for offline creation of program for opencl..
program = clCreateProgramWithBinary(context, 1, &device_id, (const size_t *)&binary_size, (const unsigned char **)&binary_buf, &binary_status, &ret);
where binary_buf is...
fread(binary_buf, 1, MAX_BINARY_SIZE, fp);
Hence in offline compilation, we can skip the clBuildProgram step, which makes this step faster. (Is this approach correct, that we can re-use again and again that binary for running the program?)
So, my question is how to create opencl binary file so i can skip the step of building cl program?