Top Description Fields Constructors Methods
com.jogamp.opencl

public Class CLBuffer<B extends Buffer>

extends CLMemory<B extends Buffer>
Class Inheritance
Known Direct Subclasses
com.jogamp.opencl.CLSubBuffer, com.jogamp.opencl.gl.CLGLBuffer
Imports
com.jogamp.common.nio.Buffers, .PointerBuffer, java.util.List, .ArrayList, .Collections, com.jogamp.opencl.llb.CL, .CLBufferBinding, java.nio.Buffer

OpenCL buffer object wrapping an optional NIO buffer.
Author
Michael Bien, et al.

Field Summary

Modifier and TypeField and Description
private List<CLSubBuffer<B>>
Inherited from com.jogamp.opencl.CLMemory:
bufferclCapacityelementSizeFLAGSsize

Constructor Summary

AccessConstructor and Description
protected
CLBuffer(final CLContext context, final long size, final long id, final int flags)

protected
CLBuffer(final CLContext context, final B directBuffer, final long size, final long id, final int flags)

Method Summary

Modifier and TypeMethod and Description
public <T extends Buffer> CLBuffer<T>
cloneWith(final T directBuffer)

Implements abstract com.jogamp.opencl.CLMemory.cloneWith.

Returns a new instance of CLMemory pointing to the same CLResource but using a different Buffer.
pack-priv static CLBuffer<?>
create(final CLContext context, final int size, final int flags)

pack-priv static <B extends Buffer> CLBuffer<B>
create(final CLContext context, final B directBuffer, final int flags)

public CLSubBuffer<B>
createSubBuffer(int
The offset in buffer elements.
offset
,
int
The size in buffer elements.
size
,
final CLMemory.Mem... flags)

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

public List<CLSubBuffer<B>>
getSubBuffers()

Returns the list of subbuffers.

public boolean
isSubBuffer()

Returns true if this is a sub buffer.

pack-priv void
public void
release()

Overrides com.jogamp.opencl.CLMemory.release.

Implements com.jogamp.opencl.CLResource.release.

Releases the OpenCL resource.
Inherited from com.jogamp.opencl.CLMemory:
equalsgetBuffergetCLgetCLCapacitygetCLSizegetConfiggetElementSizegetMapCountgetNIOCapacitygetNIOSizegetSizeImplhashCodeinitCLCapacityisHostPointerFlagisReadOnlyisReadWriteisWriteOnlyregisterDestructorCallbacktoStringuse

Field Detail

childsback to summary
private List<CLSubBuffer<B>> childs

Constructor Detail

CLBufferback to summary
protected CLBuffer(final CLContext context, final long size, final long id, final int flags)
CLBufferback to summary
protected CLBuffer(final CLContext context, final B directBuffer, final long size, final long id, final int flags)

Method Detail

cloneWithback to summary
public <T extends Buffer> CLBuffer<T> cloneWith(final T directBuffer)

Implements abstract com.jogamp.opencl.CLMemory.cloneWith.

Doc from com.jogamp.opencl.CLMemory.cloneWith.

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

Annotations
@Override
createback to summary
pack-priv static CLBuffer<?> create(final CLContext context, final int size, final int flags)
Annotations
@SuppressWarnings:rawtypes
createback to summary
pack-priv static <B extends Buffer> CLBuffer<B> create(final CLContext context, final B directBuffer, final int flags)
createSubBufferback to summary
public CLSubBuffer<B> createSubBuffer(int offset, int size, final 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:int

The offset in buffer elements.

size:int

The size in buffer elements.

getSubBuffersback to summary
public List<CLSubBuffer<B>> getSubBuffers()

Returns the list of subbuffers.

Annotations
@SuppressWarnings:unchecked
isSubBufferback to summary
public boolean isSubBuffer()

Returns true if this is a sub buffer.

onReleaseSubBufferback to summary
pack-priv void onReleaseSubBuffer(final CLSubBuffer<?> sub)
releaseback to summary
public void release()

Overrides com.jogamp.opencl.CLMemory.release.

Implements com.jogamp.opencl.CLResource.release.

Doc from com.jogamp.opencl.CLResource.release.

Releases the OpenCL resource.

Annotations
@Override