clCreateContext with CGL_SHAREGROUP returns -30

Hi, please do you have some ideas that why I’m getting error code -30 (CL_INVALID_VALUE )?

  • macbook pro, 10.7.2
  • GL_SHARING_EXTENSION supported
  
CGLContextObj kCGLContext = CGLGetCurrentContext();
CGLShareGroupObj kCGLShareGroup = CGLGetShareGroup(kCGLContext);
cl_context_properties props[] =
    {
        CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE,           
        (cl_context_properties)kCGLShareGroup,
        0
    };
context = clCreateContext(props, 0, 0, 0, 0, &errCode);

You have to use the man pages to interpret these.

i.e.:
http://www.khronos.org/registry/cl/sdk/ … ntext.html

Errors

clCreateContext returns a valid non-zero context and errcode_ret is set to CL_SUCCESS if the context is created successfully. Otherwise, it returns NULL value with the following error values returned in errcode_ret:

* CL_INVALID_VALUE if context property name in properties is not a supported property name; if devices is NULL; if num_devices is equal to zero; or if pfn_notify is NULL but user_data is not NULL.