Package org.nd4j.linalg.cache
Interface ConstantHandler
-
- All Known Implementing Classes:
BasicConstantHandler
public interface ConstantHandler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetCachedBytes()This method returns memory used for cache, in bytesDataBuffergetConstantBuffer(boolean[] array, DataType dataType)This method returns DataBuffer with constant equal to input array.DataBuffergetConstantBuffer(double[] array, DataType dataType)This method returns DataBuffer with contant equal to input array.DataBuffergetConstantBuffer(float[] array, DataType dataType)This method returns DataBuffer with contant equal to input array.DataBuffergetConstantBuffer(int[] array, DataType dataType)DataBuffergetConstantBuffer(long[] array, DataType dataType)This method returns DataBuffer with constant equal to input array.longmoveToConstantSpace(DataBuffer dataBuffer)If specific hardware supports dedicated constant memory, this method forces DataBuffer passed in to be moved to that constant memory.voidpurgeConstants()This method removes all cached constantsDataBufferrelocateConstantSpace(DataBuffer dataBuffer)PLEASE NOTE: This method implementation is hardware-dependant.
-
-
-
Method Detail
-
moveToConstantSpace
long moveToConstantSpace(DataBuffer dataBuffer)
If specific hardware supports dedicated constant memory, this method forces DataBuffer passed in to be moved to that constant memory. PLEASE NOTE: This method implementation is hardware-dependant.- Parameters:
dataBuffer-- Returns:
-
relocateConstantSpace
DataBuffer relocateConstantSpace(DataBuffer dataBuffer)
PLEASE NOTE: This method implementation is hardware-dependant. PLEASE NOTE: This method does NOT allow concurrent use of any array- Parameters:
dataBuffer-- Returns:
-
getConstantBuffer
DataBuffer getConstantBuffer(boolean[] array, DataType dataType)
This method returns DataBuffer with constant equal to input array. PLEASE NOTE: This method assumes that you'll never ever change values within result DataBuffer- Parameters:
array-- Returns:
-
getConstantBuffer
DataBuffer getConstantBuffer(int[] array, DataType dataType)
-
getConstantBuffer
DataBuffer getConstantBuffer(long[] array, DataType dataType)
This method returns DataBuffer with constant equal to input array. PLEASE NOTE: This method assumes that you'll never ever change values within result DataBuffer- Parameters:
array-- Returns:
-
getConstantBuffer
DataBuffer getConstantBuffer(double[] array, DataType dataType)
This method returns DataBuffer with contant equal to input array. PLEASE NOTE: This method assumes that you'll never ever change values within result DataBuffer- Parameters:
array-- Returns:
-
getConstantBuffer
DataBuffer getConstantBuffer(float[] array, DataType dataType)
This method returns DataBuffer with contant equal to input array. PLEASE NOTE: This method assumes that you'll never ever change values within result DataBuffer- Parameters:
array-- Returns:
-
purgeConstants
void purgeConstants()
This method removes all cached constants
-
getCachedBytes
long getCachedBytes()
This method returns memory used for cache, in bytes- Returns:
-
-