Skip to content

Commit 242ad4e

Browse files
committed
add a ut to guard the change
1 parent 32e2ac7 commit 242ad4e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Owner(s): ["module: intel"]
2+
import os
3+
4+
import torch
5+
from torch.testing._internal.common_utils import TestCase
6+
7+
8+
class TestXpuOpsHeader(TestCase):
9+
def test_xpu_ops_header(self):
10+
include_dir = os.path.join(os.path.dirname(torch.__file__), "include")
11+
aten_ops_dir = os.path.join(include_dir, "ATen/ops")
12+
self.assertTrue(
13+
os.path.exists(os.path.join(aten_ops_dir, "cat_xpu_dispatch.h"))
14+
)
15+
self.assertTrue(
16+
os.path.exists(os.path.join(aten_ops_dir, "index_fill_xpu_dispatch.h"))
17+
)
18+
self.assertTrue(os.path.exists(os.path.join(aten_ops_dir, "col2im_native.h")))
19+
with open(os.path.join(aten_ops_dir, "col2im_native.h")) as fr:
20+
text = fr.read()
21+
self.assertTrue("col2im_xpu" in text)

0 commit comments

Comments
 (0)