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.
()
| 43 | |
| 44 | |
| 45 | def 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) |
nothing calls this directly
no test coverage detected