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, this api will be deprecated and removed in future versions.

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

  • device_target (str, optional) – The target device specified, should be one of "CPU" , "GPU" and "Ascend" . Default None , represents the current device set by context.

Returns

tuple(param1, param2) for GPU.

  • param1 - int, cuda major revision number.

  • param2 - int, cuda minor revision number.

None for Ascend and CPU.

Examples

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