int ret = cl.clGetPlatformIDs(0, null, ib);
checkForError(ret, "can not enumerate platforms");
// receive platform ids
NativeSizeBuffer platformId = NativeSizeBuffer.allocateDirect(ib.get(0));
ret = cl.clGetPlatformIDs(platformId.capacity(), platformId, null);
checkForError(ret, "can not enumerate platforms");
List<CLPlatform> platforms = new ArrayList<CLPlatform>();
for (int i = 0; i < platformId.capacity(); i++) {