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)
| 314 | |
| 315 | |
| 316 | def 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…