use of org.apache.sysml.runtime.controlprogram.caching.CacheException in project incubator-systemml by apache.
the class GPUObject method acquireHostRead.
/**
* if the data is allocated on the GPU and is dirty, it is copied back to the host memory
* @return true if a copy to host happened, false otherwise
* @throws CacheException ?
*/
public boolean acquireHostRead() throws CacheException {
boolean copied = false;
try {
LOG.trace("GPU : acquireDeviceModifySparse on " + this + ", GPUContext=" + getGPUContext());
if (isAllocated() && dirty) {
LOG.trace("GPU : data is dirty on device, copying to host, on " + this + ", GPUContext=" + getGPUContext());
copyFromDeviceToHost();
copied = true;
}
} catch (DMLRuntimeException e) {
throw new CacheException(e);
}
return copied;
}
Aggregations