public interface AffinityManager
Modifier and Type | Interface and Description |
---|---|
static class |
AffinityManager.Location |
Modifier and Type | Method and Description |
---|---|
void |
allowCrossDeviceAccess(boolean reallyAllow)
This method allows to block cross-device access.
|
void |
attachThreadToDevice(long threadId,
java.lang.Integer deviceId)
This method attaches specified thread (by Id) to specified device
|
void |
attachThreadToDevice(java.lang.Thread thread,
java.lang.Integer deviceId)
This method attaches specified thread to specified device
|
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
|
java.lang.Integer |
getDeviceForArray(INDArray array)
This method returns id of current device for a given INDArray
|
java.lang.Integer |
getDeviceForCurrentThread()
This method returns deviceId for current thread
|
java.lang.Integer |
getDeviceForThread(long threadId)
This method returns deviceId for specified threadId
|
java.lang.Integer |
getDeviceForThread(java.lang.Thread thread)
This method returns deviceId for specified 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(java.lang.Integer deviceId,
DataBuffer buffer)
This method replicates given DataBuffer, and places it to target device.
|
INDArray |
replicateToDevice(java.lang.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 |
touch(DataBuffer buffer)
Utility method, to associate INDArray with specific device (backend-specific)
|
void |
touch(INDArray array)
Utility method, to associate INDArray with specific device (backend-specific)
|
void |
unsafeSetDevice(java.lang.Integer deviceId)
This method forces specific device for current thread.
|
java.lang.Integer getDeviceForCurrentThread()
java.lang.Integer getDeviceForThread(java.lang.Thread thread)
thread
- java.lang.Integer getDeviceForThread(long threadId)
threadId
- java.lang.Integer getDeviceForArray(INDArray array)
array
- void attachThreadToDevice(java.lang.Thread thread, java.lang.Integer deviceId)
thread
- deviceId
- void attachThreadToDevice(long threadId, java.lang.Integer deviceId)
threadId
- java ID of the threaddeviceId
- int getNumberOfDevices()
void touch(INDArray array)
array
- void touch(DataBuffer buffer)
buffer
- INDArray replicateToDevice(java.lang.Integer deviceId, INDArray array)
deviceId
- target deviceIdarray
- INDArray to replicateDataBuffer replicateToDevice(java.lang.Integer deviceId, DataBuffer buffer)
deviceId
- target deviceIdbuffer
- void tagLocation(INDArray array, AffinityManager.Location location)
location
- void tagLocation(DataBuffer buffer, AffinityManager.Location location)
location
- void ensureLocation(INDArray array, AffinityManager.Location location)
array
- location
- AffinityManager.Location getActiveLocation(INDArray array)
array
- void unsafeSetDevice(java.lang.Integer deviceId)
deviceId
- boolean isCrossDeviceAccessSupported()
void allowCrossDeviceAccess(boolean reallyAllow)
reallyAllow
-