Class GPULazyCudaFreeMemoryManager
- java.lang.Object
-
- org.apache.sysds.runtime.instructions.gpu.context.GPULazyCudaFreeMemoryManager
-
public class GPULazyCudaFreeMemoryManager extends Object
-
-
Constructor Summary
Constructors Constructor Description GPULazyCudaFreeMemoryManager(GPUMemoryManager gpuManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(long size, jcuda.Pointer toFree)Add a pointer to the rmvar-ed listvoidclearAll()Set<jcuda.Pointer>getAllPointers()intgetNumPointers()Get total number of rmvared pointersjcuda.PointergetRmvarPointer(String opcode, long size)Get any pointer of the given size from rmvar-ed pointers (applicable if eager cudaFree is set to false)jcuda.PointergetRmvarPointerMinSize(String opcode, long minSize)longgetTotalMemoryAllocated()Return the total memory in bytes used by this memory managervoidremoveIfPresent(long size, jcuda.Pointer ptr)Remove a specific pointer if present in the internal hashmap
-
-
-
Constructor Detail
-
GPULazyCudaFreeMemoryManager
public GPULazyCudaFreeMemoryManager(GPUMemoryManager gpuManager)
-
-
Method Detail
-
getRmvarPointer
public jcuda.Pointer getRmvarPointer(String opcode, long size)
Get any pointer of the given size from rmvar-ed pointers (applicable if eager cudaFree is set to false)- Parameters:
opcode- opcodesize- size in bytes- Returns:
- pointer
-
getAllPointers
public Set<jcuda.Pointer> getAllPointers()
-
clearAll
public void clearAll()
-
getRmvarPointerMinSize
public jcuda.Pointer getRmvarPointerMinSize(String opcode, long minSize) throws DMLRuntimeException
- Throws:
DMLRuntimeException
-
getTotalMemoryAllocated
public long getTotalMemoryAllocated()
Return the total memory in bytes used by this memory manager- Returns:
- number of bytes
-
getNumPointers
public int getNumPointers()
Get total number of rmvared pointers- Returns:
- number of pointers
-
add
public void add(long size, jcuda.Pointer toFree)Add a pointer to the rmvar-ed list- Parameters:
size- size of the pointertoFree- pointer
-
removeIfPresent
public void removeIfPresent(long size, jcuda.Pointer ptr)Remove a specific pointer if present in the internal hashmap- Parameters:
size- size in bytesptr- pointer to be removed
-
-