I have two related questions here and so I am asking as one question:
1- We compile the opencl-program at run time using
clCreateProgramWithSource(context, 1, (const char**)&source, NULL, NULL);
clBuildProgram(program, 1, &device, NULL, NULL,
NULL);
My question is every time my opencl application runs it will do this compilation, and it might take considerable time. Is there a way so that the compilation will happen for the first time, and in subsequent application runs, it uses the binary from the previous compilation?
2- What are the different ways to speed up the compilation using clBuildProgram()
? may be using compiler flags or something else?