Skip to content

Commit

Permalink
add a ut to guard the change
Browse files Browse the repository at this point in the history
  • Loading branch information
guangyey committed Feb 27, 2025
1 parent 7f0c50a commit 0b53f33
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/regressions/test_xpu_ops_header.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Owner(s): ["module: intel"]
import os

import torch
from torch.testing._internal.common_utils import TestCase


class TestXpuOpsHeader(TestCase):
def test_xpu_ops_header(self):
include_dir = os.path.join(os.path.dirname(torch.__file__), "include")
aten_ops_dir = os.path.join(include_dir, "ATen/ops")
self.assertTrue(
os.path.exists(os.path.join(aten_ops_dir, "cat_xpu_dispatch.h"))
)
self.assertTrue(
os.path.exists(os.path.join(aten_ops_dir, "index_fill_xpu_dispatch.h"))
)
self.assertTrue(os.path.exists(os.path.join(aten_ops_dir, "col2im_native.h")))
with open(os.path.join(aten_ops_dir, "col2im_native.h")) as fr:
text = fr.read()
self.assertTrue("col2im_xpu" in text)

0 comments on commit 0b53f33

Please sign in to comment.