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

Function has_multi_gpu

python/tvm/testing/env.py:226–231  ·  view source on GitHub ↗

True if at least ``count`` devices of a single GPU backend exist.

(count: int = 2)

Source from the content-addressed store, hash-verified

224
225@functools.cache
226def has_multi_gpu(count: int = 2) -> bool:
227 """True if at least ``count`` devices of a single GPU backend exist."""
228 for kind in ("cuda", "rocm", "opencl", "metal", "vulkan"):
229 if all(_device_exists(kind, index) for index in range(count)):
230 return True
231 return False
232
233
234# --- build-support probes --------------------------------------------------

Callers

nothing calls this directly

Calls 2

_device_existsFunction · 0.85
allFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…