public abstract class BasicAffinityManager extends Object implements AffinityManager
AffinityManager.Location
Constructor and Description |
---|
BasicAffinityManager() |
Modifier and Type | Method and Description |
---|---|
void |
allowCrossDeviceAccess(boolean reallyAllow)
This method allows to block cross-device access.
|
void |
ensureLocation(INDArray array,
AffinityManager.Location location)
This method propagates given INDArray to specified location
|
AffinityManager.Location |
getActiveLocation(INDArray array)
This method returns last-updated location for the given INDArray
|
Integer |
getDeviceForArray(INDArray array)
This method returns id of current device for a given INDArray
|
Integer |
getDeviceForCurrentThread()
This method returns deviceId for current thread
|
Integer |
getDeviceForThread(long threadId)
This method returns deviceId for a given thread
|
int |
getNumberOfDevices()
This method returns number of available devices
|
boolean |
isCrossDeviceAccessSupported()
This method returns TRUE if cross-device access is allowed on this system
|
DataBuffer |
replicateToDevice(Integer deviceId,
DataBuffer buffer)
This method replicates given DataBuffer, and places it to target device.
|
INDArray |
replicateToDevice(Integer deviceId,
INDArray array)
This method replicates given INDArray, and places it to target device.
|
void |
tagLocation(DataBuffer buffer,
AffinityManager.Location location)
This method tags specific DataBuffer as "recent" on specified location
|
void |
tagLocation(INDArray array,
AffinityManager.Location location)
This method tags specific INDArray as "recent" on specified location
|
void |
unsafeSetDevice(Integer deviceId)
This method forces specific device for current thread.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
touch, touch
public Integer getDeviceForCurrentThread()
AffinityManager
getDeviceForCurrentThread
in interface AffinityManager
public Integer getDeviceForThread(long threadId)
AffinityManager
getDeviceForThread
in interface AffinityManager
public Integer getDeviceForArray(INDArray array)
AffinityManager
getDeviceForArray
in interface AffinityManager
public int getNumberOfDevices()
AffinityManager
getNumberOfDevices
in interface AffinityManager
public INDArray replicateToDevice(Integer deviceId, INDArray array)
replicateToDevice
in interface AffinityManager
deviceId
- target deviceIdarray
- INDArray to replicatepublic DataBuffer replicateToDevice(Integer deviceId, DataBuffer buffer)
replicateToDevice
in interface AffinityManager
deviceId
- target deviceIdbuffer
- public void tagLocation(INDArray array, AffinityManager.Location location)
AffinityManager
tagLocation
in interface AffinityManager
public void tagLocation(DataBuffer buffer, AffinityManager.Location location)
AffinityManager
tagLocation
in interface AffinityManager
public void unsafeSetDevice(Integer deviceId)
AffinityManager
unsafeSetDevice
in interface AffinityManager
public void ensureLocation(INDArray array, AffinityManager.Location location)
AffinityManager
ensureLocation
in interface AffinityManager
public boolean isCrossDeviceAccessSupported()
AffinityManager
isCrossDeviceAccessSupported
in interface AffinityManager
public void allowCrossDeviceAccess(boolean reallyAllow)
AffinityManager
allowCrossDeviceAccess
in interface AffinityManager
public AffinityManager.Location getActiveLocation(INDArray array)
AffinityManager
getActiveLocation
in interface AffinityManager
Copyright © 2020. All rights reserved.