mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fixes https://github.com/pytorch/pytorch/pull/84848#discussion_r986329680 @malfet @slgong-fb Pull Request resolved: https://github.com/pytorch/pytorch/pull/86199 Approved by: https://github.com/malfet
27 lines
765 B
Python
27 lines
765 B
Python
# Owner(s): ["module: intel"]
|
|
|
|
import torch
|
|
import unittest
|
|
from torch.testing._internal.common_utils import TestCase, run_tests, load_tests
|
|
|
|
# load_tests from common_utils is used to automatically filter tests for
|
|
# sharding on sandcastle. This line silences flake warnings
|
|
load_tests = load_tests
|
|
|
|
@unittest.skipIf(not torch.profiler.itt.is_available(), "ITT is required")
|
|
class TestItt(TestCase):
|
|
def setUp(self):
|
|
super(TestItt, self).setUp()
|
|
|
|
def tearDown(self):
|
|
super(TestItt, self).tearDown()
|
|
|
|
def test_itt(self):
|
|
# Just making sure we can see the symbols
|
|
torch.profiler.itt.range_push("foo")
|
|
torch.profiler.itt.mark("bar")
|
|
torch.profiler.itt.range_pop()
|
|
|
|
if __name__ == '__main__':
|
|
run_tests()
|