cupy.cuda.Device¶
-
class
cupy.cuda.
Device
¶ Object that represents a CUDA device.
This class provides some basic manipulations on CUDA devices.
It supports the context protocol. For example, the following code is an example of temporarily switching the current device:
with Device(0): do_something_on_device_0()
After the with statement gets done, the current device is reset to the original one.
Parameters: device (int or cupy.cuda.Device) – Index of the device to manipulate. Be careful that the device ID (a.k.a. GPU ID) is zero origin. If it is a Device object, then its ID is used. The current device is selected by default. Variables: id (int) – ID of this device. Methods
-
__enter__
()¶
-
__exit__
()¶
-
synchronize
()¶ Synchronizes the current thread to the device.
-
use
()¶ Makes this device current.
If you want to switch a device temporarily, use the with statement.
Attributes
-
compute_capability
¶ Compute capability of this device.
The capability is represented by a string containing the major index and the minor index. For example, compute capability 3.5 is represented by the string ‘35’.
-
cublas_handle
¶ The cuBLAS handle for this device.
The same handle is used for the same device even if the Device instance itself is different.
-
cusolver_handle
¶ The cuSOLVER handle for this device.
The same handle is used for the same device even if the Device instance itself is different.
-
id
¶
-