Skip to content

Commit 7fd0e17

Browse files
committed
Improve asserts
1 parent 104af5b commit 7fd0e17

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/CodeGen_GPU_Dev.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ void CodeGen_GPU_C::visit(const Shuffle *op) {
161161

162162
std::vector<std::string> vecs;
163163
for (const Expr &v : op->vectors) {
164-
std::string expr = print_expr(v);
165-
internal_assert(!expr.empty()) << "Expression did not serialize.";
166-
vecs.push_back(std::move(expr));
164+
vecs.push_back(print_expr(v));
167165
}
168166

169167
std::string src = vecs[0];
@@ -190,8 +188,8 @@ void CodeGen_GPU_C::visit(const Shuffle *op) {
190188
break;
191189
}
192190
}
193-
internal_assert(lane_idx != -1) << "Shuffle lane index not found.";
194-
internal_assert(vector_idx < op->vectors.size()) << "Shuffle vector index not found.";
191+
internal_assert(lane_idx != -1) << "Shuffle lane index not found: i=" << i;
192+
internal_assert(vector_idx < op->vectors.size()) << "Shuffle vector index not found: i=" << i << ", lane=" << lane_idx;
195193
rhs << vecs[vector_idx];
196194
if (op->vectors[vector_idx].type().lanes() > 1) {
197195
switch (vector_declaration_style) {

0 commit comments

Comments
 (0)