Return whether an optional build flag (e.g. ``USE_CUTLASS``) is on. A flag counts as enabled unless it is explicitly disabled, so library flags carrying a path (rather than a boolean) still register as present. Callers gate on this via ``@pytest.mark.skipif(not tvm.testing.env.has_cutla
(flag: str)
| 113 | |
| 114 | @functools.cache |
| 115 | def _build_flag_enabled(flag: str) -> bool: |
| 116 | """Return whether an optional build flag (e.g. ``USE_CUTLASS``) is on. |
| 117 | |
| 118 | A flag counts as enabled unless it is explicitly disabled, so library |
| 119 | flags carrying a path (rather than a boolean) still register as present. |
| 120 | Callers gate on this via ``@pytest.mark.skipif(not tvm.testing.env.has_cutlass(), ...)``. |
| 121 | """ |
| 122 | try: |
| 123 | value = tvm.support.libinfo().get(flag, "OFF") |
| 124 | return str(value).lower() not in ("off", "false", "0") |
| 125 | except Exception: # pylint: disable=broad-except |
| 126 | return False |
| 127 | |
| 128 | |
| 129 | @functools.cache |
no test coverage detected
searching dependent graphs…