public abstract class GPUObject extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GPUObject.EvictionPolicy |
Modifier and Type | Field and Description |
---|---|
static GPUObject.EvictionPolicy |
evictionPolicy |
protected boolean |
isDeviceCopyModified |
protected boolean |
isInSparseFormat |
protected org.apache.sysml.runtime.controlprogram.caching.MatrixObject |
mat |
protected AtomicInteger |
numLocks |
Modifier | Constructor and Description |
---|---|
protected |
GPUObject(org.apache.sysml.runtime.controlprogram.caching.MatrixObject mat2) |
Modifier and Type | Method and Description |
---|---|
abstract void |
acquireDeviceModifyDense()
To signal intent that a matrix block will be written to on the GPU
|
abstract void |
acquireDeviceModifySparse()
To signal intent that a sparse matrix block will be written to on the GPU
|
abstract void |
acquireDeviceRead() |
abstract void |
acquireHostModify() |
abstract void |
acquireHostRead() |
void |
clearData() |
protected static void |
evict(long GPUSize)
Cycles through the sorted list of allocated
GPUObject instances. |
protected static long |
getAvailableMemory() |
abstract boolean |
isAllocated() |
boolean |
isInSparseFormat() |
abstract void |
releaseInput() |
abstract void |
releaseOutput() |
abstract void |
setDeviceModify(long numBytes)
If memory on GPU has been allocated from elsewhere, this method
updates the internal bookkeeping
|
public static final GPUObject.EvictionPolicy evictionPolicy
protected boolean isDeviceCopyModified
protected AtomicInteger numLocks
protected boolean isInSparseFormat
protected org.apache.sysml.runtime.controlprogram.caching.MatrixObject mat
protected GPUObject(org.apache.sysml.runtime.controlprogram.caching.MatrixObject mat2)
public boolean isInSparseFormat()
public abstract boolean isAllocated()
public abstract void acquireDeviceRead() throws DMLRuntimeException
DMLRuntimeException
public abstract void acquireDeviceModifyDense() throws DMLRuntimeException
DMLRuntimeException
- if DMLRuntimeException occurspublic abstract void acquireDeviceModifySparse() throws DMLRuntimeException
DMLRuntimeException
- if DMLRuntimeException occurspublic abstract void setDeviceModify(long numBytes)
numBytes
- number of bytespublic abstract void acquireHostRead() throws org.apache.sysml.runtime.controlprogram.caching.CacheException
org.apache.sysml.runtime.controlprogram.caching.CacheException
public abstract void acquireHostModify() throws org.apache.sysml.runtime.controlprogram.caching.CacheException
org.apache.sysml.runtime.controlprogram.caching.CacheException
public abstract void releaseInput() throws org.apache.sysml.runtime.controlprogram.caching.CacheException
org.apache.sysml.runtime.controlprogram.caching.CacheException
public abstract void releaseOutput() throws org.apache.sysml.runtime.controlprogram.caching.CacheException
org.apache.sysml.runtime.controlprogram.caching.CacheException
protected static void evict(long GPUSize) throws DMLRuntimeException
GPUObject
instances. Sorting is based on
number of (read) locks that have been obtained on it (reverse order). It repeatedly frees up
blocks on which there are zero locks until the required size has been freed up.
// TODO: update it with hybrid policyGPUSize
- Desired size to be freed up on the GPUDMLRuntimeException
- If no blocks to free up or if not enough blocks with zero locks on them.public void clearData() throws org.apache.sysml.runtime.controlprogram.caching.CacheException
org.apache.sysml.runtime.controlprogram.caching.CacheException
protected static long getAvailableMemory()
Copyright © 2017 The Apache Software Foundation. All rights reserved.