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

Function enabled_targets

python/tvm/testing/utils.py:501–522  ·  view source on GitHub ↗

Get all enabled targets with associated devices. In most cases, you should use :py:func:`tvm.testing.parametrize_targets` instead of this function. In this context, enabled means that TVM was built with support for this target, the target name appears in the TVM_TEST_TARGETS en

()

Source from the content-addressed store, hash-verified

499
500
501def enabled_targets():
502 """Get all enabled targets with associated devices.
503
504 In most cases, you should use :py:func:`tvm.testing.parametrize_targets` instead of
505 this function.
506
507 In this context, enabled means that TVM was built with support for
508 this target, the target name appears in the TVM_TEST_TARGETS
509 environment variable, and a suitable device for running this
510 target exists. If TVM_TEST_TARGETS is not set, it defaults to
511 variable DEFAULT_TEST_TARGETS in this module.
512
513 If you use this function in a test, you **must** mark the test with
514 ``@pytest.mark.gpu`` (otherwise it will never be run on the gpu).
515
516 Returns
517 -------
518 targets: list
519 A list of pairs of all enabled devices and the associated context
520
521 """
522 return [(t["target"], tvm.device(t["target_kind"])) for t in _get_targets() if t["is_runnable"]]
523
524
525def _parse_target_entry(entry):

Callers

nothing calls this directly

Calls 2

_get_targetsFunction · 0.85
deviceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…