return createSubDevices(props)[0];
}
private CLSubDevice[] createSubDevices(LongBuffer props) {
CL cl = CLPlatform.getLowLevelCLInterface();
IntBuffer ib = Buffers.newDirectIntBuffer(1);
int ret = cl.clCreateSubDevicesEXT(ID, props, 0, null, ib);
CLException.checkForError(ret, "create sub devices failed");
int count = ib.get(0);
NativeSizeBuffer ids = NativeSizeBuffer.allocateDirect(count);
ret = cl.clCreateSubDevicesEXT(ID, props, count, ids, null);
CLException.checkForError(ret, "create sub devices failed");
CLSubDevice[] devices = new CLSubDevice[count];
for (int i = 0; i < devices.length; i++) {
devices[i] = CLSubDevice.createSubDevice(this, ids.get());