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

Common superclass for all OpenCL memory types. More...

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

Classes

enum  GLObjectType
 
enum  Map
 Configures the mapping process. More...
 
enum  Mem
 Memory settings for configuring CLMemory. More...
 

Public Member Functions

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

 CLMemory (final CLContext context, final B directBuffer, final long size, final long id, final int flags)
 
final void initCLCapacity ()
 

Static Protected Member Functions

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

final int FLAGS
 
long size
 
int elementSize
 
int clCapacity
 

Detailed Description

Common superclass for all OpenCL memory types.

Represents an OpenCL memory object and wraps an optional NIO buffer.

Author
Michael Bien, et al.

Definition at line 49 of file CLMemory.java.

Constructor & Destructor Documentation

◆ CLMemory()

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

Definition at line 65 of file CLMemory.java.

Here is the call graph for this function:

Member Function Documentation

◆ cloneWith()

abstract< T extends Buffer > CLMemory< T > com.jogamp.opencl.CLMemory< B extends Buffer >.cloneWith ( directBuffer)
abstract

Returns a new instance of CLMemory pointing to the same CLResource but using a different Buffer.

◆ equals()

boolean com.jogamp.opencl.CLMemory< B extends Buffer >.equals ( final Object  obj)

Returns the OpenGL buffer type of this shared buffer.

Definition at line 256 of file CLMemory.java.

Here is the caller graph for this function:

◆ getBuffer()

B com.jogamp.opencl.CLMemory< B extends Buffer >.getBuffer ( )

Returns the optional NIO buffer for this memory object.

Definition at line 137 of file CLMemory.java.

Here is the caller graph for this function:

◆ getCL()

static CL com.jogamp.opencl.CLMemory< B extends Buffer >.getCL ( final CLContext  context)
staticprotected

Definition at line 99 of file CLMemory.java.

Here is the call graph for this function:

◆ getCLCapacity()

int com.jogamp.opencl.CLMemory< B extends Buffer >.getCLCapacity ( )

Returns the size in buffer elements of this memory object.

Definition at line 171 of file CLMemory.java.

Here is the caller graph for this function:

◆ getCLSize()

long com.jogamp.opencl.CLMemory< B extends Buffer >.getCLSize ( )

Returns the size of the allocated OpenCL memory in bytes.

Definition at line 164 of file CLMemory.java.

Here is the caller graph for this function:

◆ getConfig()

EnumSet< Mem > com.jogamp.opencl.CLMemory< B extends Buffer >.getConfig ( )

Returns the configuration of this memory object.

Definition at line 186 of file CLMemory.java.

Here is the call graph for this function:

◆ getElementSize()

int com.jogamp.opencl.CLMemory< B extends Buffer >.getElementSize ( )

Returns the size in bytes of a single buffer element.

This method returns 1 if no buffer is available indicating regular byte access.

Definition at line 179 of file CLMemory.java.

Here is the caller graph for this function:

◆ getMapCount()

int com.jogamp.opencl.CLMemory< B extends Buffer >.getMapCount ( )

Returns the number of buffer mappings.

The map count returned should be considered immediately stale. It is unsuitable for general use in applications. This feature is provided for debugging.

Definition at line 194 of file CLMemory.java.

Here is the call graph for this function:

◆ getNIOCapacity()

int com.jogamp.opencl.CLMemory< B extends Buffer >.getNIOCapacity ( )

Returns the capacity of the wrapped direct buffer or 0 if no buffer available.

Definition at line 144 of file CLMemory.java.

Here is the caller graph for this function:

◆ getNIOSize()

int com.jogamp.opencl.CLMemory< B extends Buffer >.getNIOSize ( )

Returns the size of the wrapped direct buffer in byte or 0 if no buffer available.

Definition at line 154 of file CLMemory.java.

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

◆ getSizeImpl()

static long com.jogamp.opencl.CLMemory< B extends Buffer >.getSizeImpl ( final CLContext  context,
final long  id 
)
staticprotected

Definition at line 91 of file CLMemory.java.

Here is the call graph for this function:

◆ hashCode()

int com.jogamp.opencl.CLMemory< B extends Buffer >.hashCode ( )

Definition at line 274 of file CLMemory.java.

Here is the call graph for this function:

◆ initCLCapacity()

final void com.jogamp.opencl.CLMemory< B extends Buffer >.initCLCapacity ( )
protected

Definition at line 79 of file CLMemory.java.

Here is the caller graph for this function:

◆ isHostPointerFlag()

static boolean com.jogamp.opencl.CLMemory< B extends Buffer >.isHostPointerFlag ( final int  flags)
staticprotected

Returns true if a host pointer must be specified on mem object creation.

Definition at line 86 of file CLMemory.java.

◆ isReadOnly()

boolean com.jogamp.opencl.CLMemory< B extends Buffer >.isReadOnly ( )

Returns true if this memory object was created with the Mem#READ_ONLY flag.

Definition at line 204 of file CLMemory.java.

◆ isReadWrite()

boolean com.jogamp.opencl.CLMemory< B extends Buffer >.isReadWrite ( )

Returns true if this memory object was created with the Mem#READ_WRITE flag.

Definition at line 218 of file CLMemory.java.

◆ isWriteOnly()

boolean com.jogamp.opencl.CLMemory< B extends Buffer >.isWriteOnly ( )

Returns true if this memory object was created with the Mem#WRITE_ONLY flag.

Definition at line 211 of file CLMemory.java.

◆ registerDestructorCallback()

void com.jogamp.opencl.CLMemory< B extends Buffer >.registerDestructorCallback ( final CLMemObjectListener  listener)

Registers a callback which will be called by the OpenCL implementation when the memory object is released.

Definition at line 107 of file CLMemory.java.

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

◆ release()

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

Releases the OpenCL resource.

Implements com.jogamp.opencl.CLResource.

Definition at line 223 of file CLMemory.java.

Here is the call graph for this function:

◆ toString()

String com.jogamp.opencl.CLMemory< B extends Buffer >.toString ( )

Reimplemented from com.jogamp.opencl.CLObject.

Definition at line 282 of file CLMemory.java.

◆ use()

CLMemory< B > com.jogamp.opencl.CLMemory< B extends Buffer >.use ( final B  buffer)

Definition at line 122 of file CLMemory.java.

Here is the call graph for this function:

Member Data Documentation

◆ clCapacity

int com.jogamp.opencl.CLMemory< B extends Buffer >.clCapacity
protected

Definition at line 57 of file CLMemory.java.

◆ elementSize

int com.jogamp.opencl.CLMemory< B extends Buffer >.elementSize
protected

Definition at line 56 of file CLMemory.java.

◆ FLAGS

final int com.jogamp.opencl.CLMemory< B extends Buffer >.FLAGS
protected

Definition at line 52 of file CLMemory.java.

◆ size

long com.jogamp.opencl.CLMemory< B extends Buffer >.size
protected

Definition at line 53 of file CLMemory.java.


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