Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit a96a0e0

Browse files
committed
Add test case for reported failure in halide2isl
See #124, #125.
1 parent f315eaf commit a96a0e0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/test_tc_mapper_bugs.cc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,27 @@ TEST(LayerNorm, ReferenceBelongsToTwoGroups) {
696696
atCompl.compile("layernorm", inputs, options);
697697
}
698698

699+
// #124
700+
TEST(Halide2Isl, MinInUpperBound) {
701+
at::Tensor mat1 = at::CUDA(at::kFloat).rand({1, 100, 184, 184});
702+
at::Tensor mat1_pad = at::CUDA(at::kFloat).rand({1, 100, 186, 186});
703+
at::Tensor mat2 = at::CUDA(at::kFloat).rand({3, 3});
704+
std::vector<at::Tensor> inputs = {mat1, mat1_pad, mat2};
705+
706+
static constexpr auto TC = R"TC(
707+
def graph2(float(N, C, H, W) I, float(N, C, R, T) J, float(KH, KW) W1) -> (O, Out) {
708+
O(n, c, h, w) +=! J(n, c, h + kh, w + kw) * W1(kh, kw)
709+
Out(i, j) +=! I(n, i, h, w) * O(n, j, h, w)
710+
}
711+
)TC";
712+
auto options = tc::MappingOptions::makeNaiveMappingOptions();
713+
714+
tc::ATenCompilationUnit atCompl;
715+
atCompl.define(TC);
716+
EXPECT_THROW(
717+
atCompl.compile("graph2", inputs, options), isl::exception_invalid);
718+
}
719+
699720
int main(int argc, char** argv) {
700721
::testing::InitGoogleTest(&argc, argv);
701722
::gflags::ParseCommandLineFlags(&argc, &argv, true);

0 commit comments

Comments
 (0)