NativeSizeBuffer info = NativeSizeBuffer.allocateDirect(2);
info.put(offset).put(size).rewind();
int bitset = Mem.flagsToInt(flags);
CLBufferBinding binding = getPlatform().getBufferBinding();
int[] err = new int[1];
long subID = binding.clCreateSubBuffer(ID, bitset, CL.CL_BUFFER_CREATE_TYPE_REGION, info.getBuffer(), err, 0);
checkForError(err[0], "can not create sub buffer");
CLSubBuffer<B> clSubBuffer = new CLSubBuffer<B>(this, offset, size, slice, subID, bitset);
if(childs == null) {
childs = new ArrayList<CLSubBuffer<B>>();