MCPcopy Create free account
hub / github.com/pytorch/executorch / is_cuda_available

Function is_cuda_available

install_utils.py:45–56  ·  view source on GitHub ↗

Check if CUDA is available on the system by attempting to get the CUDA version. Returns: True if CUDA is available and supported, False otherwise.

()

Source from the content-addressed store, hash-verified

43
44
45def is_cuda_available() -> bool:
46 """
47 Check if CUDA is available on the system by attempting to get the CUDA version.
48
49 Returns:
50 True if CUDA is available and supported, False otherwise.
51 """
52 try:
53 _get_cuda_version()
54 return True
55 except Exception:
56 return False
57
58
59@functools.lru_cache(maxsize=1)

Callers

nothing calls this directly

Calls 1

_get_cuda_versionFunction · 0.85

Tested by

no test coverage detected