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

Function _runtime_enabled

python/tvm/testing/env.py:150–160  ·  view source on GitHub ↗

True if the runtime was built with support for target ``kind``. Used for kinds whose device existence does not imply the backend was compiled in -- notably ``llvm``, which maps to the always-present CPU device, so ``tvm.device("llvm").exist`` is True even on ``USE_LLVM=OFF``.

(kind: str)

Source from the content-addressed store, hash-verified

148
149@functools.cache
150def _runtime_enabled(kind: str) -> bool:
151 """True if the runtime was built with support for target ``kind``.
152
153 Used for kinds whose device existence does not imply the backend was
154 compiled in -- notably ``llvm``, which maps to the always-present CPU
155 device, so ``tvm.device("llvm").exist`` is True even on ``USE_LLVM=OFF``.
156 """
157 try:
158 return bool(tvm.runtime.enabled(kind))
159 except Exception: # pylint: disable=broad-except
160 return False
161
162
163def _device_usable(kind: str) -> bool:

Callers 1

has_llvmFunction · 0.85

Calls 1

enabledMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…