public class ProtectedCudaConstantHandler extends Object implements ConstantHandler
Modifier and Type | Field and Description |
---|---|
protected Map<Integer,Map<ArrayDescriptor,DataBuffer>> |
buffersCache |
protected Map<Integer,AtomicLong> |
constantOffsets |
protected Map<Integer,org.bytedeco.javacpp.Pointer> |
deviceAddresses |
protected Map<Integer,Semaphore> |
deviceLocks |
protected FlowController |
flowController |
protected Semaphore |
lock |
protected NativeOps |
nativeOps |
protected static ConstantProtector |
protector |
Modifier and Type | Method and Description |
---|---|
protected int |
amountOfEntries(int deviceId)
Method suited for debug purposes only
|
DataBuffer |
getConstantBuffer(double[] array)
This method returns DataBuffer with contant equal to input array.
|
DataBuffer |
getConstantBuffer(float[] array)
This method returns DataBuffer with contant equal to input array.
|
DataBuffer |
getConstantBuffer(int[] array)
This method returns DataBuffer with contant equal to input array.
|
static ProtectedCudaConstantHandler |
getInstance() |
long |
moveToConstantSpace(DataBuffer dataBuffer)
This method moves specified dataBuffer to CUDA constant memory space.
|
void |
purgeConstants()
This method removes all cached constants
|
DataBuffer |
relocateConstantSpace(DataBuffer dataBuffer)
PLEASE NOTE: This method implementation is hardware-dependant.
|
protected Map<Integer,AtomicLong> constantOffsets
protected Map<Integer,Map<ArrayDescriptor,DataBuffer>> buffersCache
protected NativeOps nativeOps
protected FlowController flowController
protected static final ConstantProtector protector
protected Semaphore lock
public static ProtectedCudaConstantHandler getInstance()
public void purgeConstants()
purgeConstants
in interface ConstantHandler
protected int amountOfEntries(int deviceId)
public long moveToConstantSpace(DataBuffer dataBuffer)
moveToConstantSpace
in interface ConstantHandler
dataBuffer
- public DataBuffer relocateConstantSpace(DataBuffer dataBuffer)
relocateConstantSpace
in interface ConstantHandler
dataBuffer
- public DataBuffer getConstantBuffer(int[] array)
getConstantBuffer
in interface ConstantHandler
array
- public DataBuffer getConstantBuffer(float[] array)
getConstantBuffer
in interface ConstantHandler
array
- public DataBuffer getConstantBuffer(double[] array)
getConstantBuffer
in interface ConstantHandler
array
- Copyright © 2016. All Rights Reserved.