Interface GPUMemoryAllocator
- 
- All Known Implementing Classes:
- CudaMemoryAllocator,- UnifiedMemoryAllocator
 
 public interface GPUMemoryAllocator
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidallocate(jcuda.Pointer devPtr, long size)Allocate memory on the device.booleancanAllocate(long size)Check if there is enough memory to allocate a pointer of given sizevoidfree(jcuda.Pointer devPtr)Frees memory on the devicelonggetAvailableMemory()Gets the available memory on GPU that SystemDS can use.
 
- 
- 
- 
Method Detail- 
allocatevoid allocate(jcuda.Pointer devPtr, long size) throws jcuda.CudaExceptionAllocate memory on the device.- Parameters:
- devPtr- Pointer to allocated device memory
- size- size in bytes
- Throws:
- jcuda.CudaException- if unable to allocate
 
 - 
freevoid free(jcuda.Pointer devPtr) throws jcuda.CudaException Frees memory on the device- Parameters:
- devPtr- Device pointer to memory to free
- Throws:
- jcuda.CudaException- if error occurs
 
 - 
canAllocateboolean canAllocate(long size) Check if there is enough memory to allocate a pointer of given size- Parameters:
- size- size in bytes
- Returns:
- true if there is enough available memory to allocate a pointer of the given size
 
 - 
getAvailableMemorylong getAvailableMemory() Gets the available memory on GPU that SystemDS can use.- Returns:
- the available memory in bytes
 
 
- 
 
-