Search in sources :

Example 1 with CacheException

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;
}
Also used : CacheException(org.apache.sysml.runtime.controlprogram.caching.CacheException) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException)

Aggregations

DMLRuntimeException (org.apache.sysml.runtime.DMLRuntimeException)1 CacheException (org.apache.sysml.runtime.controlprogram.caching.CacheException)1