JOCL v2.6.0-rc-20250722
JOCL, OpenCL® API Binding for Java™ (public API).
com.jogamp.opencl.CLBuffer< B extends Buffer > Class Template Reference

OpenCL buffer object wrapping an optional NIO buffer. More...

Inheritance diagram for com.jogamp.opencl.CLBuffer< B extends Buffer >:
Collaboration diagram for com.jogamp.opencl.CLBuffer< B extends Buffer >:

Public Member Functions

CLSubBuffer< B > createSubBuffer (int offset, int size, final Mem... flags)
 Creates a sub buffer with the specified region from this buffer. More...
 
void release ()
 
List< CLSubBuffer< B > > getSubBuffers ()
 Returns the list of subbuffers. More...
 
boolean isSubBuffer ()
 Returns true if this is a sub buffer. More...
 
- Public Member Functions inherited from com.jogamp.opencl.CLMemory< B >
void registerDestructorCallback (final CLMemObjectListener listener)
 Registers a callback which will be called by the OpenCL implementation when the memory object is released. More...
 
abstract< T extends Buffer > CLMemory< T > cloneWith (T directBuffer)
 Returns a new instance of CLMemory pointing to the same CLResource but using a different Buffer. More...
 
CLMemory< B > use (final B buffer)
 
getBuffer ()
 Returns the optional NIO buffer for this memory object. More...
 
int getNIOCapacity ()
 Returns the capacity of the wrapped direct buffer or 0 if no buffer available. More...
 
int getNIOSize ()
 Returns the size of the wrapped direct buffer in byte or 0 if no buffer available. More...
 
long getCLSize ()
 Returns the size of the allocated OpenCL memory in bytes. More...
 
int getCLCapacity ()
 Returns the size in buffer elements of this memory object. More...
 
int getElementSize ()
 Returns the size in bytes of a single buffer element. More...
 
EnumSet< MemgetConfig ()
 Returns the configuration of this memory object. More...
 
int getMapCount ()
 Returns the number of buffer mappings. More...
 
boolean isReadOnly ()
 Returns true if this memory object was created with the Mem#READ_ONLY flag. More...
 
boolean isWriteOnly ()
 Returns true if this memory object was created with the Mem#WRITE_ONLY flag. More...
 
boolean isReadWrite ()
 Returns true if this memory object was created with the Mem#READ_WRITE flag. More...
 
void release ()
 Releases the OpenCL resource. More...
 
boolean equals (final Object obj)
 Returns the OpenGL buffer type of this shared buffer. More...
 
int hashCode ()
 
String toString ()
 

Protected Member Functions

 CLBuffer (final CLContext context, final long size, final long id, final int flags)
 
 CLBuffer (final CLContext context, final B directBuffer, final long size, final long id, final int flags)
 
- Protected Member Functions inherited from com.jogamp.opencl.CLMemory< B >
 CLMemory (final CLContext context, final B directBuffer, final long size, final long id, final int flags)
 
final void initCLCapacity ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from com.jogamp.opencl.CLMemory< B >
static boolean isHostPointerFlag (final int flags)
 Returns true if a host pointer must be specified on mem object creation. More...
 
static long getSizeImpl (final CLContext context, final long id)
 
static CL getCL (final CLContext context)
 
- Protected Attributes inherited from com.jogamp.opencl.CLMemory< B >
final int FLAGS
 
long size
 
int elementSize
 
int clCapacity
 

Detailed Description

OpenCL buffer object wrapping an optional NIO buffer.

Author
Michael Bien, et al.

Definition at line 46 of file CLBuffer.java.

Constructor & Destructor Documentation

◆ CLBuffer() [1/2]

com.jogamp.opencl.CLBuffer< B extends Buffer >.CLBuffer ( final CLContext  context,
final long  size,
final long  id,
final int  flags 
)
protected

Definition at line 50 of file CLBuffer.java.

◆ CLBuffer() [2/2]

com.jogamp.opencl.CLBuffer< B extends Buffer >.CLBuffer ( final CLContext  context,
final B  directBuffer,
final long  size,
final long  id,
final int  flags 
)
protected

Definition at line 54 of file CLBuffer.java.

Member Function Documentation

◆ createSubBuffer()

CLSubBuffer< B > com.jogamp.opencl.CLBuffer< B extends Buffer >.createSubBuffer ( int  offset,
int  size,
final Mem...  flags 
)

Creates a sub buffer with the specified region from this buffer.

If this buffer contains a NIO buffer, the sub buffer will also contain a slice matching the specified region of the parent buffer. The region is specified by the offset and size in buffer elements or bytes if this buffer does not contain any NIO buffer.

Parameters
offsetThe offset in buffer elements.
sizeThe size in buffer elements.

Definition at line 101 of file CLBuffer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSubBuffers()

List< CLSubBuffer< B > > com.jogamp.opencl.CLBuffer< B extends Buffer >.getSubBuffers ( )

Returns the list of subbuffers.

Definition at line 149 of file CLBuffer.java.

Here is the caller graph for this function:

◆ isSubBuffer()

boolean com.jogamp.opencl.CLBuffer< B extends Buffer >.isSubBuffer ( )

Returns true if this is a sub buffer.

Definition at line 160 of file CLBuffer.java.

Here is the caller graph for this function:

◆ release()

void com.jogamp.opencl.CLBuffer< B extends Buffer >.release ( )

Definition at line 132 of file CLBuffer.java.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: