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 long
getCachedBytes()
This method returns memory used for cache, in bytesDataBuffer
getConstantBuffer(boolean[] array, DataType dataType)
This method returns DataBuffer with constant equal to input array.DataBuffer
getConstantBuffer(double[] array, DataType dataType)
This method returns DataBuffer with contant equal to input array.DataBuffer
getConstantBuffer(float[] array, DataType dataType)
This method returns DataBuffer with contant equal to input array.DataBuffer
getConstantBuffer(int[] array, DataType dataType)
DataBuffer
getConstantBuffer(long[] array, DataType dataType)
This method returns DataBuffer with constant equal to input array.long
moveToConstantSpace(DataBuffer dataBuffer)
If specific hardware supports dedicated constant memory, this method forces DataBuffer passed in to be moved to that constant memory.void
purgeConstants()
This method removes all cached constantsDataBuffer
relocateConstantSpace(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:
-
-