mindspore.hal.get_device_capability

View Source On Gitee
mindspore.hal.get_device_capability(device_id, device_target=None)[source]

Get specified device's capability.

Note

If device_target is not specified, get the device capability of the current backend set by context.

Parameters
  • device_id (int) – The device id of which the capability will be returned.

  • device_target (str, optional) – The device name of backend, should be one of "CPU", "GPU" and "Ascend".

Returns

tuple(int, int) for GPU.

  • param1 - int, cuda major revision number.

  • param2 - int, cuda minor revision number.

None for Ascend and CPU.

Examples

>>> import mindspore as ms
>>> device_target = ms.context.get_context("device_target")
>>> print(ms.hal.get_device_capability(0, device_target))