public class CudaAffinityManager extends BasicAffinityManager
AffinityManager.Location
Constructor and Description |
---|
CudaAffinityManager() |
Modifier and Type | Method and Description |
---|---|
void |
attachThreadToDevice(long threadId,
Integer deviceId) |
void |
attachThreadToDevice(Thread thread,
Integer deviceId) |
Integer |
getDeviceForCurrentThread() |
Integer |
getDeviceForThread(long threadId) |
Integer |
getDeviceForThread(Thread thread) |
protected Integer |
getNextDevice(long threadId) |
int |
getNumberOfDevices() |
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) |
void |
tagLocation(INDArray array,
AffinityManager.Location 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)
|
public Integer getDeviceForCurrentThread()
getDeviceForCurrentThread
in interface AffinityManager
getDeviceForCurrentThread
in class BasicAffinityManager
public Integer getDeviceForThread(Thread thread)
getDeviceForThread
in interface AffinityManager
getDeviceForThread
in class BasicAffinityManager
public Integer getDeviceForThread(long threadId)
getDeviceForThread
in interface AffinityManager
getDeviceForThread
in class BasicAffinityManager
public void attachThreadToDevice(Thread thread, Integer deviceId)
attachThreadToDevice
in interface AffinityManager
attachThreadToDevice
in class BasicAffinityManager
public void attachThreadToDevice(long threadId, Integer deviceId)
attachThreadToDevice
in interface AffinityManager
attachThreadToDevice
in class BasicAffinityManager
protected Integer getNextDevice(long threadId)
public int getNumberOfDevices()
getNumberOfDevices
in interface AffinityManager
getNumberOfDevices
in class BasicAffinityManager
public void touch(INDArray array)
array
- public void touch(DataBuffer buffer)
buffer
- public INDArray replicateToDevice(Integer deviceId, INDArray array)
replicateToDevice
in interface AffinityManager
replicateToDevice
in class BasicAffinityManager
deviceId
- target deviceIdarray
- INDArray to replicatepublic DataBuffer replicateToDevice(Integer deviceId, DataBuffer buffer)
replicateToDevice
in interface AffinityManager
replicateToDevice
in class BasicAffinityManager
deviceId
- target deviceIdbuffer
- public void tagLocation(INDArray array, AffinityManager.Location location)
tagLocation
in interface AffinityManager
tagLocation
in class BasicAffinityManager
public void tagLocation(DataBuffer buffer, AffinityManager.Location location)
tagLocation
in interface AffinityManager
tagLocation
in class BasicAffinityManager
Copyright © 2016. All Rights Reserved.