To use the Interoperation function we need to include the
cl_gl.h header file. This header contains declaration of the required function for interoperation.
Before discussing other implementation steps, we try to detect whether the current environment supports this interoperation. We use the OpenCL API
clGetDeviceInfo(…) for this purpose. The first call would get the total size needed to store the string (
char*) returned by the second call. This string is a list of all the device extensions that are supported by the current environment. We then try to find from this list, whether it has an item called
cl_khr_gl_sharing for Windows and Linux and