29package com.jogamp.opencl;
31import com.jogamp.common.nio.Buffers;
32import com.jogamp.opencl.CLMemory.Mem;
33import java.nio.Buffer;
42 private final int offset;
44 CLSubBuffer(
final CLBuffer<B> parent,
final int origin,
final int size,
final B directBuffer,
final long id,
final int flags) {
45 super(parent.getContext(), directBuffer, size,
id, flags);
56 throw new UnsupportedOperationException(
"creating sub buffers from sub buffers is not allowed.");
61 parent.onReleaseSubBuffer(
this);
76 final int elemSize = buffer==
null ? 1 : Buffers.sizeOfBufferElem(buffer);
77 return offset/elemSize;
OpenCL buffer object wrapping an optional NIO buffer.
A sub buffer of a CLBuffer.
CLSubBuffer< B > createSubBuffer(final int origin, final int size, final Mem... flags)
Throws an UnsupportedOperationException since creating sub buffers from sub buffers is not allowed as...
int getOffset()
Returns the offset of this sub buffer to its parent in buffer elements.
CLBuffer< B > getParent()
Returns the parent buffer this buffer was created from.
boolean isSubBuffer()
Returns true.
int getCLOffset()
Returns the offset of this sub buffer to its parent in bytes.
Memory settings for configuring CLMemory.