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

java.lang.Object
  extended by com.jogamp.opencl.CLObject
      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
 
Fields inherited from class com.jogamp.opencl.CLMemory
clCapacity, elementSize, FLAGS, size
 
Fields inherited from class com.jogamp.opencl.CLObject
context, ID
 
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.
 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.
 boolean isReleased()
          Returns true if CLResource.release() has been called.
 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, initCLCapacity, isHostPointerFlag, isReadOnly, isReadWrite, isWriteOnly, registerDestructorCallback, toString, use
 
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
 

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, satisfying AutoCloseable. Might be remove as soon we have extension methods, but shall validate with Java 1.5 specs.

Specified by:
close in interface AutoCloseable
See Also:
AutoCloseable

isReleased

public boolean isReleased()
Description copied from interface: CLResource
Returns true if CLResource.release() has been called.

Specified by:
isReleased in interface CLResource