Package com.jogamp.opencl
Class CLBuffer<B extends Buffer>
- java.lang.Object
-
- com.jogamp.opencl.CLObject
-
- com.jogamp.opencl.CLMemory<B>
-
- com.jogamp.opencl.CLBuffer<B>
-
- All Implemented Interfaces:
AutoCloseable
,CLResource
,AutoCloseable
- Direct Known Subclasses:
CLGLBuffer
,CLSubBuffer
public class CLBuffer<B extends Buffer> extends CLMemory<B>
OpenCL buffer object wrapping an optional NIO buffer.- Author:
- Michael Bien, et al.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jogamp.opencl.CLMemory
CLMemory.GLObjectType, CLMemory.Map, CLMemory.Mem
-
-
Field Summary
-
Fields inherited from class com.jogamp.opencl.CLMemory
clCapacity, elementSize, FLAGS, size
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <T extends Buffer>
CLBuffer<T>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.CLSubBuffer<B>
createSubBuffer(int offset, int size, CLMemory.Mem... flags)
Creates a sub buffer with the specified region from this buffer.List<CLSubBuffer<B>>
getSubBuffers()
Returns the list of subbuffers.boolean
isReleased()
Returns true ifCLResource.release()
has been called.boolean
isSubBuffer()
Returns true if this is a sub buffer.void
release()
Releases the OpenCL resource.-
Methods inherited from class com.jogamp.opencl.CLMemory
equals, getBuffer, getCL, getCLCapacity, getCLSize, getConfig, getElementSize, getMapCount, getNIOCapacity, getNIOSize, getSizeImpl, hashCode, initCLCapacity, isHostPointerFlag, isReadOnly, isReadWrite, isWriteOnly, registerDestructorCallback, toString, use
-
Methods inherited from class com.jogamp.opencl.CLObject
getContext, getID, getPlatform
-
-
-
-
Method Detail
-
createSubBuffer
public CLSubBuffer<B> createSubBuffer(int offset, int size, CLMemory.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:
offset
- The offset in buffer elements.size
- The size in buffer elements.
-
release
public void release()
Description copied from interface:CLResource
Releases the OpenCL resource.
-
getSubBuffers
public List<CLSubBuffer<B>> getSubBuffers()
Returns the list of subbuffers.
-
isSubBuffer
public boolean isSubBuffer()
Returns true if this is a sub buffer.
-
cloneWith
public <T extends Buffer> CLBuffer<T> cloneWith(T directBuffer)
Description copied from class:CLMemory
Returns a new instance of CLMemory pointing to the same CLResource but using a different Buffer.
-
close
@Deprecated public final void close()
Deprecated.This method is not intended to be called from client code.Implementation detail, satisfyingAutoCloseable
. Might be remove as soon we have extension methods, but shall validate with Java 1.5 specs.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceAutoCloseable
- See Also:
AutoCloseable
-
isReleased
public boolean isReleased()
Description copied from interface:CLResource
Returns true ifCLResource.release()
has been called.- Specified by:
isReleased
in interfaceCLResource
-
-