MCPcopy Create free account
hub / github.com/apache/tvm / has_cuda_compute

Function has_cuda_compute

python/tvm/testing/env.py:316–329  ·  view source on GitHub ↗

True if the CUDA compute capability satisfies ``(major, minor)``. When ``exact`` is False (default) the check is ``compute >= (major, minor)``; when True it requires an exact match. Returns False when no CUDA device is present, so it implies :func:`has_cuda`.

(major: int, minor: int = 0, exact: bool = False)

Source from the content-addressed store, hash-verified

314
315
316def has_cuda_compute(major: int, minor: int = 0, exact: bool = False) -> bool:
317 """True if the CUDA compute capability satisfies ``(major, minor)``.
318
319 When ``exact`` is False (default) the check is ``compute >= (major,
320 minor)``; when True it requires an exact match. Returns False when no
321 CUDA device is present, so it implies :func:`has_cuda`.
322 """
323 if not has_cuda():
324 return False
325 compute = _cuda_compute_version()
326 want = (major, minor)
327 if exact:
328 return compute == want
329 return compute >= want
330
331
332@functools.cache

Callers

nothing calls this directly

Calls 2

has_cudaFunction · 0.85
_cuda_compute_versionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…