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

Commit d0961ba

Browse files
Drop dead code in test_tc2halide.cc
1 parent be1528c commit d0961ba

File tree

1 file changed

+17
-25
lines changed

1 file changed

+17
-25
lines changed

test/test_tc2halide.cc

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,7 @@ using namespace tc::dlutils;
3232

3333
struct TC2Isl : public ::testing::Test {
3434
void SetUp() {}
35-
void Check(const string& tc, const std::vector<long>& inputSizes) {
36-
auto ctx = getCPUDLContext();
37-
DLDataType dtype;
38-
dtype.code = kDLFloat;
39-
dtype.bits = 32;
40-
dtype.lanes = 1;
41-
auto UPtr = makeDLTensorWithSizes(ctx, dtype, inputSizes);
42-
std::vector<const DLTensor*> inputs{UPtr.get()};
43-
35+
void Check(const string& tc) {
4436
auto halide =
4537
tc2halide::translate(isl::with_exceptions::globalIslCtx(), tc);
4638
auto scop = polyhedral::Scop::makeScop(
@@ -57,7 +49,7 @@ def fun(float(M) I) -> (O) {
5749
O(i) = I(i)
5850
}
5951
)TC";
60-
Check(tc, {123});
52+
Check(tc);
6153
}
6254

6355
TEST_F(TC2Isl, Copy2D) {
@@ -66,7 +58,7 @@ def fun(float(M, N) I) -> (O) {
6658
O(i, j) = I(i, j)
6759
}
6860
)TC";
69-
Check(tc, {123, 1});
61+
Check(tc);
7062
}
7163

7264
TEST_F(TC2Isl, Copy3D) {
@@ -75,7 +67,7 @@ def fun(float(M, N, P) I) -> (O) {
7567
O(i, j, k) = I(i, j, k)
7668
}
7769
)TC";
78-
Check(tc, {123, 3, 2});
70+
Check(tc);
7971
}
8072

8173
TEST_F(TC2Isl, Copy4D) {
@@ -84,7 +76,7 @@ def fun(float(M, N, P, Q) I) -> (O) {
8476
O(i, j, k, l) = I(i, j, k, l)
8577
}
8678
)TC";
87-
Check(tc, {123, 3, 4, 5});
79+
Check(tc);
8880
}
8981

9082
TEST_F(TC2Isl, Copy5D) {
@@ -93,7 +85,7 @@ def fun(float(M, N, P, Q, R) I) -> (O) {
9385
O(i, j, k, l, m) = I(i, j, k, l, m)
9486
}
9587
)TC";
96-
Check(tc, {123, 10, 2, 3, 4});
88+
Check(tc);
9789
}
9890

9991
// Invalid TC atm
@@ -103,7 +95,7 @@ def fun(float(M) I) -> (O) {
10395
O(0) +=! I(i)
10496
}
10597
)TC";
106-
Check(tc, {123});
98+
Check(tc);
10799
}
108100

109101
TEST_F(TC2Isl, Reduction2D) {
@@ -112,7 +104,7 @@ def fun(float(M, N) I) -> (O) {
112104
O(i) +=! I(i, j)
113105
}
114106
)TC";
115-
Check(tc, {123, 12});
107+
Check(tc);
116108
}
117109

118110
TEST_F(TC2Isl, Reduction3D) {
@@ -121,7 +113,7 @@ def fun(float(M, N, P) I) -> (O) {
121113
O(i) +=! I(i, j, k)
122114
}
123115
)TC";
124-
Check(tc, {123, 12, 16});
116+
Check(tc);
125117
}
126118

127119
TEST_F(TC2Isl, Copy1D2Stmt) {
@@ -131,7 +123,7 @@ def fun(float(M) I) -> (O1, O2) {
131123
O2(i) = O1(i)
132124
}
133125
)TC";
134-
Check(tc, {123});
126+
Check(tc);
135127
}
136128

137129
TEST_F(TC2Isl, Copy2D2Stmt) {
@@ -141,7 +133,7 @@ def fun(float(M, N) I) -> (O1, O2) {
141133
O2(i, j) = O1(i, j)
142134
}
143135
)TC";
144-
Check(tc, {123, 13});
136+
Check(tc);
145137
}
146138

147139
TEST_F(TC2Isl, Copy2D3Stmt) {
@@ -152,7 +144,7 @@ def fun(float(M, N) I) -> (O1, O2, O3) {
152144
O3(i, j) = O2(i, j)
153145
}
154146
)TC";
155-
Check(tc, {123, 13});
147+
Check(tc);
156148
}
157149

158150
// Invalid TC atm
@@ -163,7 +155,7 @@ def fun(float(M) I) -> (O1, O2) {
163155
O2(i) = O1(i)
164156
}
165157
)TC";
166-
Check(tc, {123});
158+
Check(tc);
167159
}
168160

169161
TEST_F(TC2Isl, Reduction2D2StmtA) {
@@ -173,7 +165,7 @@ def fun(float(M, N) I) -> (O1, O2) {
173165
O2(i) = O1(i)
174166
}
175167
)TC";
176-
Check(tc, {123, 13});
168+
Check(tc);
177169
}
178170

179171
TEST_F(TC2Isl, Reduction2D2StmtB) {
@@ -183,7 +175,7 @@ def fun(float(M, N) I) -> (O1, O2) {
183175
O2(i) +=! O1(i, j)
184176
}
185177
)TC";
186-
Check(tc, {123, 13});
178+
Check(tc);
187179
}
188180

189181
TEST_F(TC2Isl, Reduction2D3Stmt) {
@@ -194,7 +186,7 @@ def fun(float(M, N) I) -> (O1, O2, O3) {
194186
O3(i) = O2(i)
195187
}
196188
)TC";
197-
Check(tc, {123, 13});
189+
Check(tc);
198190
}
199191

200192
TEST_F(TC2Isl, MutableInput) {
@@ -204,7 +196,7 @@ def foo(float(N) A) -> (B) {
204196
B(k) +=! A(i) where k in 0:1
205197
}
206198
)TC";
207-
EXPECT_THROW(Check(tc, {123}), ::lang::ErrorReport);
199+
EXPECT_THROW(Check(tc), ::lang::ErrorReport);
208200
}
209201
int main(int argc, char** argv) {
210202
::testing::InitGoogleTest(&argc, argv);

0 commit comments

Comments
 (0)