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

Function _device_usable

python/tvm/testing/env.py:163–169  ·  view source on GitHub ↗

True if ``kind`` is enabled for this run and a ``kind`` device exists. The TVM_TEST_TARGETS opt-out is checked first so that an excluded backend never probes a (possibly crashy) device.

(kind: str)

Source from the content-addressed store, hash-verified

161
162
163def _device_usable(kind: str) -> bool:
164 """True if ``kind`` is enabled for this run and a ``kind`` device exists.
165
166 The TVM_TEST_TARGETS opt-out is checked first so that an excluded backend
167 never probes a (possibly crashy) device.
168 """
169 return _target_enabled(kind) and _device_exists(kind)
170
171
172# --- runtime device probes -------------------------------------------------

Callers 6

has_cudaFunction · 0.85
has_rocmFunction · 0.85
has_vulkanFunction · 0.85
has_metalFunction · 0.85
has_openclFunction · 0.85
has_nvptxFunction · 0.85

Calls 2

_target_enabledFunction · 0.85
_device_existsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…