public interface JCudaBuffer extends DataBuffer
DataBuffer.AllocationMode, DataBuffer.Type| Modifier and Type | Method and Description |
|---|---|
boolean |
copied(String name)
Returns true if the buffer has
already been copied to the device
|
void |
copyToHost(CudaContext context,
int offset,
int length)
Copy to the host synchronizing
using the given context
|
void |
copyToHost(int offset,
int length)
Copies the buffer to the host
|
boolean |
freeDevicePointer(int offset,
int length)
Frees the pointer
|
Pointer |
getDevicePointer(INDArray arr,
int stride,
int offset,
int length)
Get the device pointer with the given offset and stride
|
Pointer |
getDevicePointer(int stride,
int offset,
int length)
Get the device pointer with the given offset and stride
|
Buffer |
getHostBuffer()
Get the underlying host bytebuffer
|
Pointer |
getHostPointer()
THe pointer for the buffer
|
Pointer |
getHostPointer(int offset)
Get the host pointer with the given offset
note that this will automatically
multiply the specified offset
by the element size
|
com.google.common.collect.Table<String,org.apache.commons.lang3.tuple.Triple<Integer,Integer,Integer>,DevicePointerInfo> |
getPointersToContexts()
Pointer to context map.
|
void |
set(Pointer pointer)
Sets the data for this pointer
from the data in this pointer
|
void |
setCopied(String name)
Returns true if the data for this
thread name has already been copied
|
void |
setHostBuffer(ByteBuffer hostBuffer)
Set the underlying host buffer, very fast method of copying on RAM side and not using cublas (SLOW)
|
addReferencing, allocationMode, array, asBytes, asDouble, asFloat, asInt, asNetty, asNio, asNioDouble, asNioFloat, assign, assign, assign, assign, assign, assign, assign, assign, assign, assign, copyAtStride, dataType, destroy, dirty, dup, flush, getComplex, getComplexDouble, getComplexFloat, getDouble, getDoublesAt, getDoublesAt, getElementSize, getFloat, getFloatsAt, getFloatsAt, getInt, getNumber, isPersist, length, persist, put, put, put, put, read, references, removeReferencing, setData, setData, setData, unPersist, writevoid setHostBuffer(ByteBuffer hostBuffer)
hostBuffer - Buffer getHostBuffer()
Pointer getHostPointer()
Pointer getHostPointer(int offset)
offset - the offset (NOT MULTIPLIED BY ELEMENT SIZE) to index in to the pointer atPointer getDevicePointer(INDArray arr, int stride, int offset, int length)
arr - the array to get the device pointer forstride - the stride for the device pointeroffset - the offset for the device pointerlength - the length of the pointerPointer getDevicePointer(int stride, int offset, int length)
stride - the stride for the device pointeroffset - the offset for the device pointerlength - the length of the pointervoid set(Pointer pointer)
pointer - the pointer to setboolean freeDevicePointer(int offset,
int length)
offset - the offset to freelength - the length to freevoid copyToHost(CudaContext context, int offset, int length)
context - the context to synchronizeoffset - the offset to copylength - the length to copyvoid copyToHost(int offset,
int length)
offset - the offset for the buffer (one buffer may have multiple pointerslength - the length of the pointer (one buffer may have different lengths)com.google.common.collect.Table<String,org.apache.commons.lang3.tuple.Triple<Integer,Integer,Integer>,DevicePointerInfo> getPointersToContexts()
boolean copied(String name)
void setCopied(String name)
name - the name of the thread to
check for whether it's been copied or notCopyright © 2015. All Rights Reserved.