public class CLBuffer<T> extends CLMem
CLContextCLMem.DestructorCallback, CLMem.Flags, CLMem.GLObjectInfo, CLMem.GLObjectType, CLMem.MapFlags, CLMem.Migration, CLMem.ObjectType, CLMem.Usage| Modifier and Type | Method and Description |
|---|---|
Pointer<T> |
allocateCompatibleMemory(CLDevice device)
Returns a pointer to native memory large enough for this buffer's data, and with a compatible byte ordering.
|
<T> CLBuffer<T> |
as(Class<T> newTargetType) |
CLBuffer<Byte> |
asCLByteBuffer() |
CLBuffer<Character> |
asCLCharBuffer() |
CLBuffer<Double> |
asCLDoubleBuffer() |
CLBuffer<Float> |
asCLFloatBuffer() |
CLBuffer<Integer> |
asCLIntBuffer() |
CLBuffer<Long> |
asCLLongBuffer() |
CLBuffer<Short> |
asCLShortBuffer() |
CLEvent |
copyBytesTo(CLQueue queue,
CLBuffer destination,
long sourceByteOffset,
long destinationByteOffset,
long byteCount,
CLEvent... eventsToWaitFor)
Calls clEnqueueCopyBuffer.
|
CLEvent |
copyElementsTo(CLQueue queue,
CLBuffer destination,
long sourceElementOffset,
long destinationElementOffset,
long elementCount,
CLEvent... eventsToWaitFor)
Calls clEnqueueCopyBuffer.
|
CLEvent |
copyTo(CLQueue queue,
CLBuffer destination,
CLEvent... eventsToWaitFor)
Calls clEnqueueCopyBuffer.
|
CLEvent |
copyTo(CLQueue queue,
CLMem destination,
CLEvent... eventsToWaitFor)
enqueues a command to copy a buffer object identified by src_buffer to another buffer object identified by destination.
|
CLEvent |
copyTo(CLQueue queue,
long srcOffset,
long length,
CLMem destination,
long destOffset,
CLEvent... eventsToWaitFor)
Calls clEnqueueCopyBuffer.
|
CLBuffer<T> |
createSubBuffer(CLMem.Usage usage,
long offset,
long length)
Calls clCreateSubBuffer.
|
CLBuffer<T> |
emptyClone(CLMem.Usage usage) |
boolean |
equals(Object obj)
Underyling implementation pointer-based equality test
|
CLEvent |
fillBuffer(CLQueue queue,
Pointer<T> pattern,
CLEvent... eventsToWaitFor)
Calls clEnqueueFillBuffer.
|
CLEvent |
fillBuffer(CLQueue queue,
Pointer<T> pattern,
long patternLength,
long offset,
long length,
CLEvent... eventsToWaitFor)
Calls clEnqueueFillBuffer.
|
Class<T> |
getElementClass() |
long |
getElementCount() |
int |
getElementSize() |
static <E extends TypedPointer,A extends com.nativelibs4java.opencl.CLAbstractEntity> |
getEntities(A[] objects,
Pointer<E> out) |
PointerIO<T> |
getIO() |
int |
hashCode()
Underyling implementation pointer-based hashCode computation
|
Pointer<T> |
map(CLQueue queue,
CLMem.MapFlags flags,
CLEvent... eventsToWaitFor)
Calls clEnqueueMapBuffer.
|
Pointer<T> |
map(CLQueue queue,
CLMem.MapFlags flags,
long offset,
long length,
CLEvent... eventsToWaitFor)
Calls clEnqueueMapBuffer.
|
Pair<Pointer<T>,CLEvent> |
mapLater(CLQueue queue,
CLMem.MapFlags flags,
CLEvent... eventsToWaitFor)
Calls clEnqueueMapBuffer.
|
Pair<Pointer<T>,CLEvent> |
mapLater(CLQueue queue,
CLMem.MapFlags flags,
long offset,
long length,
CLEvent... eventsToWaitFor)
Calls clEnqueueMapBuffer.
|
CLEvent |
read(CLQueue queue,
Buffer out,
boolean blocking,
CLEvent... eventsToWaitFor)
Deprecated.
use
read(CLQueue, Pointer, boolean, CLEvent[]) instead |
Pointer<T> |
read(CLQueue queue,
CLEvent... eventsToWaitFor)
Calls clEnqueueReadBuffer.
|
CLEvent |
read(CLQueue queue,
long offset,
long length,
Buffer out,
boolean blocking,
CLEvent... eventsToWaitFor)
Deprecated.
|
Pointer<T> |
read(CLQueue queue,
long offset,
long length,
CLEvent... eventsToWaitFor)
Calls clEnqueueReadBuffer.
|
CLEvent |
read(CLQueue queue,
long offset,
long length,
Pointer<T> out,
boolean blocking,
CLEvent... eventsToWaitFor)
Calls clEnqueueReadBuffer.
|
CLEvent |
read(CLQueue queue,
Pointer<T> out,
boolean blocking,
CLEvent... eventsToWaitFor)
Calls clEnqueueReadBuffer.
|
void |
release()
Manual release of the OpenCL resources represented by this object.
|
CLEvent |
unmap(CLQueue queue,
Pointer<T> buffer,
CLEvent... eventsToWaitFor)
Calls clEnqueueUnmapMemObject.
|
CLEvent |
write(CLQueue queue,
Buffer in,
boolean blocking,
CLEvent... eventsToWaitFor)
Deprecated.
use
write(CLQueue, Pointer, boolean, CLEvent[]) instead |
CLEvent |
write(CLQueue queue,
long offset,
long length,
Buffer in,
boolean blocking,
CLEvent... eventsToWaitFor)
Deprecated.
|
CLEvent |
write(CLQueue queue,
long offset,
long length,
Pointer<T> in,
boolean blocking,
CLEvent... eventsToWaitFor)
Calls clEnqueueWriteBuffer.
|
CLEvent |
write(CLQueue queue,
Pointer<T> in,
boolean blocking,
CLEvent... eventsToWaitFor)
Calls clEnqueueWriteBuffer.
|
CLEvent |
writeBytes(CLQueue queue,
long offset,
long length,
ByteBuffer in,
boolean blocking,
CLEvent... eventsToWaitFor)
Calls clEnqueueWriteBuffer.
|
CLEvent |
writeBytes(CLQueue queue,
long offset,
long length,
Pointer<?> in,
boolean blocking,
CLEvent... eventsToWaitFor)
Calls clEnqueueWriteBuffer.
|
acquireGLObject, getByteCount, getContext, getGLObjectInfo, releaseGLObject, setDestructorCallbackpublic Class<T> getElementClass()
public int getElementSize()
public long getElementCount()
public Pointer<T> map(CLQueue queue, CLMem.MapFlags flags, CLEvent... eventsToWaitFor) throws CLException.MapFailure
queue - Execution queue for this operation.flags - Map flags.eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.CLException.MapFailurepublic Pointer<T> map(CLQueue queue, CLMem.MapFlags flags, long offset, long length, CLEvent... eventsToWaitFor) throws CLException.MapFailure
queue - Execution queue for this operation.flags - Map flags.offset - offset in the CLBufferlength - length to write (in bytes)eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.CLException.MapFailurepublic Pair<Pointer<T>,CLEvent> mapLater(CLQueue queue, CLMem.MapFlags flags, CLEvent... eventsToWaitFor) throws CLException.MapFailure
queue - Execution queue for this operation.flags - Map flags.eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.CLException.MapFailurepublic Pair<Pointer<T>,CLEvent> mapLater(CLQueue queue, CLMem.MapFlags flags, long offset, long length, CLEvent... eventsToWaitFor) throws CLException.MapFailure
queue - Execution queue for this operation.flags - Map flags.offset - offset in the CLBufferlength - length to write (in bytes)eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.CLException.MapFailurepublic CLEvent fillBuffer(CLQueue queue, Pointer<T> pattern, CLEvent... eventsToWaitFor)
queue - Execution queue for this operation.pattern - Data pattern to fill the buffer with.eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public CLEvent fillBuffer(CLQueue queue, Pointer<T> pattern, long patternLength, long offset, long length, CLEvent... eventsToWaitFor)
pattern - Data pattern to fill the buffer with.patternLength - Length in elements (not in bytes) of the pattern to use.offset - Offset in elements where to start filling the pattern.length - Length in elements of the fill (must be a multiple of patternLength).eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public Pointer<T> allocateCompatibleMemory(CLDevice device)
public Pointer<T> read(CLQueue queue, long offset, long length, CLEvent... eventsToWaitFor)
public CLBuffer<T> createSubBuffer(CLMem.Usage usage, long offset, long length)
usage - is used to specify allocation and usage information about the image memory object being created and is described in table 5.3 of the OpenCL spec.offset - length - length in bytespublic CLEvent copyTo(CLQueue queue, CLMem destination, CLEvent... eventsToWaitFor)
destination - destination buffer objecteventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public CLEvent copyTo(CLQueue queue, long srcOffset, long length, CLMem destination, long destOffset, CLEvent... eventsToWaitFor)
queue - Execution queue for this operation.srcOffset - length - length in bytesdestination - destination buffer objectdestOffset - eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public CLEvent unmap(CLQueue queue, Pointer<T> buffer, CLEvent... eventsToWaitFor)
queue - Execution queue for this operation.buffer - eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.@Deprecated public CLEvent read(CLQueue queue, Buffer out, boolean blocking, CLEvent... eventsToWaitFor)
read(CLQueue, Pointer, boolean, CLEvent[]) insteadqueue - Execution queue for this operation.out - output bufferblocking - whether the operation should be blocking (and return null), or non-blocking (and return a completion event)eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public CLEvent read(CLQueue queue, Pointer<T> out, boolean blocking, CLEvent... eventsToWaitFor)
queue - Execution queue for this operation.out - output bufferblocking - whether the operation should be blocking (and return null), or non-blocking (and return a completion event)eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.@Deprecated public CLEvent read(CLQueue queue, long offset, long length, Buffer out, boolean blocking, CLEvent... eventsToWaitFor)
read(CLQueue, long, long, Pointer, boolean, CLEvent[]) insteadqueue - Execution queue for this operation.offset - offset in the CLBufferlength - length to write (in bytes)out - output bufferblocking - whether the operation should be blocking (and return null), or non-blocking (and return a completion event)eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public CLEvent read(CLQueue queue, long offset, long length, Pointer<T> out, boolean blocking, CLEvent... eventsToWaitFor)
queue - Execution queue for this operation.offset - offset in the CLBufferlength - length to write (in bytes)out - output bufferblocking - whether the operation should be blocking (and return null), or non-blocking (and return a completion event)eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.@Deprecated public CLEvent write(CLQueue queue, Buffer in, boolean blocking, CLEvent... eventsToWaitFor)
write(CLQueue, Pointer, boolean, CLEvent[]) insteadqueue - Execution queue for this operation.in - input bufferblocking - whether the operation should be blocking (and return null), or non-blocking (and return a completion event)eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public CLEvent write(CLQueue queue, Pointer<T> in, boolean blocking, CLEvent... eventsToWaitFor)
queue - Execution queue for this operation.in - input bufferblocking - whether the operation should be blocking (and return null), or non-blocking (and return a completion event)eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.@Deprecated public CLEvent write(CLQueue queue, long offset, long length, Buffer in, boolean blocking, CLEvent... eventsToWaitFor)
write(CLQueue, long, long, Pointer, boolean, CLEvent[]) insteadqueue - Execution queue for this operation.offset - offset in the CLBufferlength - length to write (in bytes)in - input bufferblocking - whether the operation should be blocking (and return null), or non-blocking (and return a completion event)eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public CLEvent write(CLQueue queue, long offset, long length, Pointer<T> in, boolean blocking, CLEvent... eventsToWaitFor)
queue - Execution queue for this operation.offset - offset in the CLBufferlength - length to write (in bytes)in - input bufferblocking - whether the operation should be blocking (and return null), or non-blocking (and return a completion event)eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public CLEvent writeBytes(CLQueue queue, long offset, long length, ByteBuffer in, boolean blocking, CLEvent... eventsToWaitFor)
queue - Execution queue for this operation.offset - offset in the CLBufferlength - length to write (in bytes)in - input bufferblocking - whether the operation should be blocking (and return null), or non-blocking (and return a completion event)eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public CLEvent writeBytes(CLQueue queue, long offset, long length, Pointer<?> in, boolean blocking, CLEvent... eventsToWaitFor)
queue - Execution queue for this operation.offset - offset in the CLBufferlength - length to write (in bytes)in - input bufferblocking - whether the operation should be blocking (and return null), or non-blocking (and return a completion event)eventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public CLBuffer<T> emptyClone(CLMem.Usage usage)
public CLBuffer<Integer> asCLIntBuffer()
public CLBuffer<Long> asCLLongBuffer()
public CLBuffer<Short> asCLShortBuffer()
public CLBuffer<Byte> asCLByteBuffer()
public CLBuffer<Character> asCLCharBuffer()
public CLBuffer<Float> asCLFloatBuffer()
public CLBuffer<Double> asCLDoubleBuffer()
public CLEvent copyTo(CLQueue queue, CLBuffer destination, CLEvent... eventsToWaitFor)
queue - Execution queue for this operation.destination - destination buffer objecteventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public CLEvent copyBytesTo(CLQueue queue, CLBuffer destination, long sourceByteOffset, long destinationByteOffset, long byteCount, CLEvent... eventsToWaitFor)
queue - Execution queue for this operation.destination - destination buffer objectsourceByteOffset - byte offset in the sourcedestinationByteOffset - byte offset in the destinationbyteCount - number of bytes to copyeventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public CLEvent copyElementsTo(CLQueue queue, CLBuffer destination, long sourceElementOffset, long destinationElementOffset, long elementCount, CLEvent... eventsToWaitFor)
queue - Execution queue for this operation.destination - destination buffer objectsourceElementOffset - element offset in the sourcedestinationElementOffset - element offset in the destinationelementCount - number of elements to copyeventsToWaitFor - Events that need to complete before this particular command can be executed. Special value CLEvent.FIRE_AND_FORGET can be used to avoid returning a CLEvent.CLEvent.FIRE_AND_FORGET.public void release()
public static <E extends TypedPointer,A extends com.nativelibs4java.opencl.CLAbstractEntity> Pointer<E> getEntities(A[] objects, Pointer<E> out)
public int hashCode()
Copyright © 2009-2015. All Rights Reserved.