public class GPUMemoryManager extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GPUMemoryManager.EvictionPolicyBasedComparator
Class that governs the eviction policy
|
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
|
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 © 2020 The Apache Software Foundation. All rights reserved.