Thanks for your reply, I modified the code to check the context handle it seems OK. A call to get CL_CONTEXT_DEVICES also works using this handle. It came from a stripped down test case arising from a crash on the pyopencl test suite:
size_t devices_size;
cl_int errcode_ret = -42;
// ... snip what is same as in original code attached above...
hContext = clCreateContext( NULL, 1,
&cdDevice, NULL, NULL, &errcode_ret );
if( errcode_ret == CL_SUCCESS) printf("Context OK\n");
errcode_ret = clGetContextInfo( hContext, CL_CONTEXT_DEVICES,
0, NULL, &devices_size);
if( errcode_ret == CL_SUCCESS) printf("CL_CONTEXT_DEVICES OK\n");
clGetContextInfo( hContext, CL_CONTEXT_PROPERTIES,
0, NULL, &size );
The output I get is:
Number of platforms 2
id=0 CL_PLATFORM_NAME=NVIDIA CUDA
id=1 CL_PLATFORM_NAME=Intel OpenCL
Intel platform is 1
Context OK
CL_CONTEXT_DEVICES OK
... and it crashes on the call with CL_CONTEXT_PROPERTIES. Are you able to reproduce this behaviour or do I have something bad in my setup?
Many thanks,
Jon