Return whether ``tvm.device(kind, index)`` is present and usable.
(kind: str, index: int = 0)
| 103 | |
| 104 | @functools.cache |
| 105 | def _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 |
no test coverage detected
searching dependent graphs…