clBuildProgram pfn_notify

The OpenCL spec states that when using pfn_notify, “clBuildProgram does not need to wait for the build to complete and can return immediately”.

But if the call returns immediately, how can i find out whether the program was successfully built or not? There is no such thing as a cl_int passed as argument to the callback to indicate the success of the compilation.

The pfn_notify function you specified will be called when the program build has finished. You can then query the build status to see if the program was built successfully or not.

More specifically, you want to call clGetProgramBuildInfo(…, CL_PROGRAM_BUILD_STATUS, …);