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

Function has_nvcc_version

python/tvm/testing/env.py:343–350  ·  view source on GitHub ↗

True if a CUDA device is present and nvcc is at least ``(major, minor, release)``. Returns False when no CUDA device is present, so it implies :func:`has_cuda`. Gate a test with ``@pytest.mark.skipif(not tvm.testing.env.has_nvcc_version(11, 4), reason="need nvcc >= 11.4")`` (add ``@pyte

(major: int, minor: int = 0, release: int = 0)

Source from the content-addressed store, hash-verified

341
342
343def has_nvcc_version(major: int, minor: int = 0, release: int = 0) -> bool:
344 """True if a CUDA device is present and nvcc is at least ``(major, minor, release)``.
345
346 Returns False when no CUDA device is present, so it implies :func:`has_cuda`.
347 Gate a test with ``@pytest.mark.skipif(not tvm.testing.env.has_nvcc_version(11, 4),
348 reason="need nvcc >= 11.4")`` (add ``@pytest.mark.gpu`` for GPU selection).
349 """
350 return has_cuda() and _nvcc_version() >= (major, minor, release)
351
352
353@functools.cache

Callers

nothing calls this directly

Calls 2

has_cudaFunction · 0.85
_nvcc_versionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…