public class GPUMemoryManager extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GPUMemoryManager.EvictionPolicyBasedComparator
Class that governs the eviction policy
|
Modifier and Type | Field and Description |
---|---|
protected GPUMemoryAllocator |
allocator |
protected HashMap<jcuda.Pointer,org.apache.sysml.runtime.instructions.gpu.context.GPUMemoryManager.PointerInfo> |
allPointers
To record size of all allocated pointers allocated by above memory managers
|
protected GPULazyCudaFreeMemoryManager |
lazyCudaFreeMemoryManager |
protected static org.apache.commons.logging.Log |
LOG |
protected GPUMatrixMemoryManager |
matrixMemoryManager |
Constructor and Description |
---|
GPUMemoryManager(GPUContext gpuCtx) |
Modifier and Type | Method and Description |
---|---|
void |
clearMemory()
Clear the allocated GPU objects
|
void |
clearTemporaryMemory()
Clears up the memory used by non-dirty pointers.
|
void |
free(String opcode,
jcuda.Pointer toFree,
boolean eager)
Deallocate the pointer
|
GPULazyCudaFreeMemoryManager |
getGPULazyCudaFreeMemoryManager() |
GPUMatrixMemoryManager |
getGPUMatrixMemoryManager() |
long |
getSizeAllocatedGPUPointer(jcuda.Pointer ptr)
Get size of allocated GPU Pointer
|
jcuda.Pointer |
malloc(String opcode,
long size)
Allocate pointer of the given size in bytes.
|
void |
removeGPUObject(GPUObject gpuObj)
Removes the GPU object from the memory manager
|
String |
toString()
Print debugging information
|
protected static final org.apache.commons.logging.Log LOG
protected final GPUMemoryAllocator allocator
protected final GPUMatrixMemoryManager matrixMemoryManager
protected final GPULazyCudaFreeMemoryManager lazyCudaFreeMemoryManager
protected final HashMap<jcuda.Pointer,org.apache.sysml.runtime.instructions.gpu.context.GPUMemoryManager.PointerInfo> allPointers
public GPUMemoryManager(GPUContext gpuCtx)
public GPUMatrixMemoryManager getGPUMatrixMemoryManager()
public GPULazyCudaFreeMemoryManager getGPULazyCudaFreeMemoryManager()
public long getSizeAllocatedGPUPointer(jcuda.Pointer ptr)
ptr
- pointer to get size ofpublic jcuda.Pointer malloc(String opcode, long size)
opcode
- instruction namesize
- size in bytespublic void free(String opcode, jcuda.Pointer toFree, boolean eager) throws DMLRuntimeException
opcode
- instruction nametoFree
- pointer to freeeager
- whether to deallocate eagerlyDMLRuntimeException
- if error occurspublic void removeGPUObject(GPUObject gpuObj)
gpuObj
- the handle to the GPU objectpublic void clearMemory()
public void clearTemporaryMemory()
Copyright © 2018 The Apache Software Foundation. All rights reserved.