com.jogamp.opencl
Class CLSubBuffer<B extends Buffer>

java.lang.Object
  extended by com.jogamp.opencl.CLMemory<B>
      extended by com.jogamp.opencl.CLBuffer<B>
          extended by com.jogamp.opencl.CLSubBuffer<B>
All Implemented Interfaces:
AutoCloseable, CLResource

public class CLSubBuffer<B extends Buffer>
extends CLBuffer<B>

A sub buffer of a CLBuffer.

Author:
Michael Bien

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jogamp.opencl.CLMemory
CLMemory.GLObjectType, CLMemory.Map, CLMemory.Mem
 
Field Summary
protected  CL cl
           
protected  CLContext context
           
 long ID
          The OpenCL object handle.
 
Fields inherited from class com.jogamp.opencl.CLMemory
clCapacity, elementSize, FLAGS, size
 
Method Summary
 void close()
          Deprecated. This method is not intended to be called from client code.
 CLSubBuffer<B> createSubBuffer(int origin, int size, CLMemory.Mem... flags)
          Throws an UnsupportedOperationException since creating sub buffers from sub buffers is not allowed as of OpenCL 1.1.
 int getCLOffset()
          Returns the offset of this sub buffer to its parent in bytes.
 CLContext getContext()
          Returns the context for this OpenCL object.
 long getID()
          Returns the OpenCL object handle
 int getOffset()
          Returns the offset of this sub buffer to its parent in buffer elements.
 CLBuffer<B> getParent()
          Returns the parent buffer this buffer was created from.
 CLPlatform getPlatform()
          Returns the platform for this OpenCL object.
 boolean isSubBuffer()
          Returns true.
 void release()
          Releases the OpenCL resource.
 
Methods inherited from class com.jogamp.opencl.CLBuffer
cloneWith, getSubBuffers
 
Methods inherited from class com.jogamp.opencl.CLMemory
equals, getBuffer, getCL, getCLCapacity, getCLSize, getConfig, getElementSize, getMapCount, getNIOCapacity, getNIOSize, getSizeImpl, hashCode, isHostPointerFlag, isReadOnly, isReadWrite, isWriteOnly, registerDestructorCallback, toString, use
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public final long ID
The OpenCL object handle.


context

protected CLContext context

cl

protected final CL cl
Method Detail

createSubBuffer

public CLSubBuffer<B> createSubBuffer(int origin,
                                      int size,
                                      CLMemory.Mem... flags)
Throws an UnsupportedOperationException since creating sub buffers from sub buffers is not allowed as of OpenCL 1.1.

Overrides:
createSubBuffer in class CLBuffer<B extends Buffer>
Parameters:
origin - The offset in buffer elements.
size - The size in buffer elements.

release

public void release()
Description copied from interface: CLResource
Releases the OpenCL resource.

Specified by:
release in interface CLResource
Overrides:
release in class CLBuffer<B extends Buffer>

getParent

public CLBuffer<B> getParent()
Returns the parent buffer this buffer was created from.


getOffset

public int getOffset()
Returns the offset of this sub buffer to its parent in buffer elements.


getCLOffset

public int getCLOffset()
Returns the offset of this sub buffer to its parent in bytes.


isSubBuffer

public boolean isSubBuffer()
Returns true.

Overrides:
isSubBuffer in class CLBuffer<B extends Buffer>

close

@Deprecated
public final void close()
Deprecated. This method is not intended to be called from client code.

Implementation detail. TODO remove as soon we have extension methods.

Specified by:
close in interface AutoCloseable
See Also:
AutoCloseable

getContext

public CLContext getContext()
Returns the context for this OpenCL object.


getPlatform

public CLPlatform getPlatform()
Returns the platform for this OpenCL object.


getID

public long getID()
Returns the OpenCL object handle