True if a ROCm device with Matrix Core support (compute >= 8) exists.
()
| 377 | |
| 378 | @functools.cache |
| 379 | def has_matrixcore() -> bool: |
| 380 | """True if a ROCm device with Matrix Core support (compute >= 8) exists.""" |
| 381 | try: |
| 382 | from tvm.support import rocm # pylint: disable=import-outside-toplevel |
| 383 | |
| 384 | return has_rocm() and bool(rocm.have_matrixcore(tvm.rocm().compute_version)) |
| 385 | except Exception: # pylint: disable=broad-except |
| 386 | return False |
| 387 | |
| 388 | |
| 389 | @functools.cache |