ret = cl.clGetDeviceIDs(platform, CL.CL_DEVICE_TYPE_ALL, 0, null, intBuffer);
checkForError(ret);
out.println("#devices: "+intBuffer.get(0));
NativeSizeBuffer devices = NativeSizeBuffer.allocateDirect(intBuffer.get(0));
ret = cl.clGetDeviceIDs(platform, CL.CL_DEVICE_TYPE_ALL, devices.capacity(), devices, null);
//print device info
for (int j = 0; j < devices.capacity(); j++) {
long device = devices.get(j);
ret = cl.clGetDeviceInfo(device, CL.CL_DEVICE_NAME, bb.capacity(), bb, longBuffer);