MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / is_cuda_available

Function is_cuda_available

imperative/python/megengine/device.py:102–105  ·  view source on GitHub ↗

r"""Returns whether cuda device is available on this system.

()

Source from the content-addressed store, hash-verified

100
101
102def is_cuda_available() -> bool:
103 r"""Returns whether cuda device is available on this system."""
104 t = _str2device_type("gpu")
105 return CompNode._get_device_count(t, False) > 0
106
107
108def is_cambricon_available() -> bool:

Callers 4

test_deformable_convFunction · 0.90
test_batch_convbiasFunction · 0.90
test_warp_affineFunction · 0.90
runFunction · 0.90

Calls 1

_str2device_typeFunction · 0.85

Tested by 4

test_deformable_convFunction · 0.72
test_batch_convbiasFunction · 0.72
test_warp_affineFunction · 0.72
runFunction · 0.72