|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jogamp.opencl.CLObject
com.jogamp.opencl.CLMemory<B>
public abstract class CLMemory<B extends Buffer>
Common superclass for all OpenCL memory types. Represents an OpenCL memory object and wraps an optional NIO buffer.
Nested Class Summary | |
---|---|
static class |
CLMemory.GLObjectType
|
static class |
CLMemory.Map
Configures the mapping process. |
static class |
CLMemory.Mem
Memory settings for configuring CLMemory. |
Field Summary | |
---|---|
protected int |
clCapacity
|
protected int |
elementSize
|
protected int |
FLAGS
|
protected long |
size
|
Fields inherited from class com.jogamp.opencl.CLObject |
---|
context, ID |
Constructor Summary | |
---|---|
protected |
CLMemory(CLContext context,
B directBuffer,
long size,
long id,
int flags)
|
protected |
CLMemory(CLContext context,
long size,
long id,
int flags)
|
Method Summary | ||
---|---|---|
abstract
|
cloneWith(T directBuffer)
Returns a new instance of CLMemory pointing to the same CLResource but using a different Buffer. |
|
void |
close()
Deprecated. This method is not intended to be called from client code. |
|
boolean |
equals(Object obj)
Returns the OpenGL buffer type of this shared buffer. |
|
B |
getBuffer()
Returns the optional NIO buffer for this memory object. |
|
protected static CL |
getCL(CLContext context)
|
|
int |
getCLCapacity()
Returns the size in buffer elements of this memory object. |
|
long |
getCLSize()
Returns the size of the allocated OpenCL memory in bytes. |
|
EnumSet<CLMemory.Mem> |
getConfig()
Returns the configuration of this memory object. |
|
int |
getElementSize()
Returns the size in bytes of a single buffer element. |
|
int |
getMapCount()
Returns the number of buffer mappings. |
|
int |
getNIOCapacity()
Returns the capacity of the wrapped direct buffer or 0 if no buffer available. |
|
int |
getNIOSize()
Returns the size of the wrapped direct buffer in byte or 0 if no buffer available. |
|
protected static long |
getSizeImpl(CLContext context,
long id)
|
|
int |
hashCode()
|
|
protected void |
initCLCapacity()
|
|
protected static boolean |
isHostPointerFlag(int flags)
Returns true if a host pointer must be specified on mem object creation. |
|
boolean |
isReadOnly()
Returns true if this memory object was created with the CLMemory.Mem.READ_ONLY flag. |
|
boolean |
isReadWrite()
Returns true if this memory object was created with the CLMemory.Mem.READ_WRITE flag. |
|
boolean |
isReleased()
Returns true if CLResource.release() has been called. |
|
boolean |
isWriteOnly()
Returns true if this memory object was created with the CLMemory.Mem.WRITE_ONLY flag. |
|
void |
registerDestructorCallback(CLMemObjectListener listener)
Registers a callback which will be called by the OpenCL implementation when the memory object is released. |
|
void |
release()
Releases the OpenCL resource. |
|
String |
toString()
|
|
CLMemory<B> |
use(B buffer)
|
Methods inherited from class com.jogamp.opencl.CLObject |
---|
getContext, getID, getPlatform |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final int FLAGS
protected long size
protected int elementSize
protected int clCapacity
Constructor Detail |
---|
protected CLMemory(CLContext context, long size, long id, int flags)
protected CLMemory(CLContext context, B directBuffer, long size, long id, int flags)
Method Detail |
---|
protected final void initCLCapacity()
protected static boolean isHostPointerFlag(int flags)
protected static long getSizeImpl(CLContext context, long id)
protected static CL getCL(CLContext context)
public void registerDestructorCallback(CLMemObjectListener listener)
public abstract <T extends Buffer> CLMemory<T> cloneWith(T directBuffer)
public CLMemory<B> use(B buffer)
public B getBuffer()
public int getNIOCapacity()
public int getNIOSize()
public long getCLSize()
public int getCLCapacity()
public int getElementSize()
public EnumSet<CLMemory.Mem> getConfig()
public int getMapCount()
public boolean isReadOnly()
CLMemory.Mem.READ_ONLY
flag.
public boolean isWriteOnly()
CLMemory.Mem.WRITE_ONLY
flag.
public boolean isReadWrite()
CLMemory.Mem.READ_WRITE
flag.
public void release()
CLResource
release
in interface CLResource
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class CLObject
@Deprecated public final void close()
AutoCloseable
.
Might be remove as soon we have extension methods, but shall validate with Java 1.5 specs.
close
in interface AutoCloseable
AutoCloseable
public boolean isReleased()
CLResource
CLResource.release()
has been called.
isReleased
in interface CLResource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |