long context = cl.clCreateContextFromType(properties, CL.CL_DEVICE_TYPE_ALL, null, null);
out.println("context handle: "+context);
checkError("on clCreateContextFromType", ret);
NativeSizeBuffer longBuffer = NativeSizeBuffer.allocateDirect(1);
ret = cl.clGetContextInfo(context, CL.CL_CONTEXT_DEVICES, 0, null, longBuffer);
checkError("on clGetContextInfo", ret);
int deviceCount = (int) (longBuffer.get(0) / (is32Bit() ? 4 : 8));
out.println("context created with " + deviceCount + " devices");