xref: /aosp_15_r20/external/pytorch/test/test_itt.py (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1# Owner(s): ["module: intel"]
2
3import torch
4import unittest
5from torch.testing._internal.common_utils import TestCase, run_tests, load_tests
6
7# load_tests from common_utils is used to automatically filter tests for
8# sharding on sandcastle. This line silences flake warnings
9load_tests = load_tests
10
11@unittest.skipIf(not torch.profiler.itt.is_available(), "ITT is required")
12class TestItt(TestCase):
13    def test_itt(self):
14        # Just making sure we can see the symbols
15        torch.profiler.itt.range_push("foo")
16        torch.profiler.itt.mark("bar")
17        torch.profiler.itt.range_pop()
18
19if __name__ == '__main__':
20    run_tests()
21