Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[misc] Make result of irpass::print hold more information #4517

Merged
merged 1 commit into from
Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion taichi/ir/frontend_ir.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ class ExternalTensorExpression : public Expression {
}

void serialize(std::ostream &ss) override {
ss << fmt::format("{}d_ext_arr", dim);
ss << fmt::format("{}d_ext_arr (element_dim={}, dt={})", dim, element_dim,
dt->to_string());
}

void flatten(FlattenContext *ctx) override;
Expand Down Expand Up @@ -487,6 +488,10 @@ class GlobalVariableExpression : public Expression {

void serialize(std::ostream &ss) override {
ss << "#" << ident.name();
if (snode)
ss << fmt::format(" (snode={})", snode->get_node_type_name_hinted());
else
ss << fmt::format(" (dt={})", dt->to_string());
}

void flatten(FlattenContext *ctx) override;
Expand Down
2 changes: 1 addition & 1 deletion taichi/transforms/ir_printer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class IRPrinter : public IRVisitor {
}

void visit(FrontendAssertStmt *assert) override {
print("{} : assert {}", assert->id, assert->cond.serialize());
print("{} : assert {}", assert->name(), assert->cond.serialize());
}

void visit(AssertStmt *assert) override {
Expand Down