MCPcopy Create free account
hub / github.com/apache/tvm / _build_flag_enabled

Function _build_flag_enabled

python/tvm/testing/env.py:115–126  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

113
114@functools.cache
115def _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

Callers 11

has_cudnnFunction · 0.85
has_cublasFunction · 0.85
has_ncclFunction · 0.85
has_hipblasFunction · 0.85
has_cutlassFunction · 0.85
has_rpcFunction · 0.85
has_nnapiFunction · 0.85
has_openclmlFunction · 0.85
has_mrvlFunction · 0.85
has_hexagon_toolchainFunction · 0.85
has_adreno_openclFunction · 0.85

Calls 2

strFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…