MCPcopy Index your code
hub / github.com/apache/tvm / enabled

Function enabled

python/tvm/runtime/module.py:477–500  ·  view source on GitHub ↗

Whether module runtime is enabled for target Parameters ---------- target : str or Dict[str, Any] or tvm.target.Target The target device type. Returns ------- enabled : bool Whether runtime is enabled. Examples -------- The following code checks

(target)

Source from the content-addressed store, hash-verified

475
476
477def enabled(target):
478 """Whether module runtime is enabled for target
479
480 Parameters
481 ----------
482 target : str or Dict[str, Any] or tvm.target.Target
483 The target device type.
484
485 Returns
486 -------
487 enabled : bool
488 Whether runtime is enabled.
489
490 Examples
491 --------
492 The following code checks if gpu is enabled.
493
494 >>> tvm.runtime.enabled("gpu")
495 """
496 if isinstance(target, dict):
497 target = target.get("kind", "")
498 elif hasattr(target, "kind"):
499 target = target.kind.name
500 return _ffi_api.RuntimeEnabled(target)
501
502
503def num_threads() -> int:

Callers 1

__init__.pyFile · 0.90

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…