Split a compact CUDA/ROCm version string from a library filename into (major, minor). CUDA: major is always 2 digits (11, 12, 13...), e.g. '118' -> (11, 8), '132' -> (13, 2). ROCm: major is always 1 digit for now (6, 7...), e.g. '72' -> (7, 2), '713' -> (7, 13). Note: revisit if ROCm ma
(compact: str, is_hip: bool)
| 125 | |
| 126 | |
| 127 | def _split_cuda_version(compact: str, is_hip: bool) -> tuple[int, int]: |
| 128 | """Split a compact CUDA/ROCm version string from a library filename into (major, minor). |
| 129 | |
| 130 | CUDA: major is always 2 digits (11, 12, 13...), e.g. '118' -> (11, 8), '132' -> (13, 2). |
| 131 | ROCm: major is always 1 digit for now (6, 7...), e.g. '72' -> (7, 2), '713' -> (7, 13). |
| 132 | Note: revisit if ROCm major reaches 10. |
| 133 | """ |
| 134 | if is_hip: |
| 135 | return int(compact[:1]), int(compact[1:]) |
| 136 | return int(compact[:2]), int(compact[2:]) |
| 137 | |
| 138 | |
| 139 | def _find_cuda_libs(prefix: str, is_hip: bool) -> dict[tuple[int, int], Path]: |
no outgoing calls
no test coverage detected