context validation

Hi Forum,

I am creating a context with the opengl interoperability. I am checking if the created context is ok or not as follows:



cl_int status;
context = clCreateContext(.....,&status);

if(status != CL_SUCCESS)
{
         ....................
         ....................
}


Is this the only way to validate the created context is valid or not ?

Thanks
Sajjadul

Hi,

If the clCreateContext() function succeeds, then status will be set to CL_SUCCESS, and context will be non-NULL. So yes, your test should be sufficient to determine if the context is valid. You could also check that context != NULL just to be doubly sure, if you wish.

Best wishes,

James