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
()
| 499 | |
| 500 | |
| 501 | def 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 | |
| 525 | def _parse_target_entry(entry): |
nothing calls this directly
no test coverage detected
searching dependent graphs…