True if any GPU backend (cuda/rocm/opencl/metal/vulkan) is present.
()
| 212 | |
| 213 | |
| 214 | def has_gpu() -> bool: |
| 215 | """True if any GPU backend (cuda/rocm/opencl/metal/vulkan) is present.""" |
| 216 | return ( |
| 217 | _device_exists("cuda") |
| 218 | or _device_exists("rocm") |
| 219 | or _device_exists("opencl") |
| 220 | or _device_exists("metal") |
| 221 | or _device_exists("vulkan") |
| 222 | ) |
| 223 | |
| 224 | |
| 225 | @functools.cache |
nothing calls this directly
no test coverage detected
searching dependent graphs…