MCPcopy Index your code
hub / github.com/apache/tvm / _device_exists

Function _device_exists

python/tvm/testing/env.py:105–111  ·  view source on GitHub ↗

Return whether ``tvm.device(kind, index)`` is present and usable.

(kind: str, index: int = 0)

Source from the content-addressed store, hash-verified

103
104@functools.cache
105def _device_exists(kind: str, index: int = 0) -> bool:
106 """Return whether ``tvm.device(kind, index)`` is present and usable."""
107 try:
108 return bool(tvm.device(kind, index).exist)
109 except Exception: # pylint: disable=broad-except
110 # A missing backend / driver must skip the test, not crash collection.
111 return False
112
113
114@functools.cache

Callers 3

_device_usableFunction · 0.85
has_gpuFunction · 0.85
has_multi_gpuFunction · 0.85

Calls 1

deviceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…