Skip to content

Commit

Permalink
[bug] Add GetElementExpression to offline cache key (taichi-dev#6918)
Browse files Browse the repository at this point in the history
Issue: taichi-dev#4401, taichi-dev#6614

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
PGZXB and pre-commit-ci[bot] committed Dec 19, 2022
1 parent d1a1728 commit 1e6dd97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions taichi/analysis/gen_offline_cache_key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ class ASTSerializer : public IRVisitor, public ExpressionVisitor {
emit(expr->var);
}

void visit(GetElementExpression *expr) override {
emit(ExprOpCode::GetElementExpression);
emit(expr->src);
emit(expr->index);
}

void visit(Block *block) override {
emit(StmtOpCode::EnterBlock);
emit(static_cast<std::size_t>(block->statements.size()));
Expand Down
1 change: 1 addition & 0 deletions taichi/inc/expressions.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ PER_EXPRESSION(MeshIndexConversionExpression)
PER_EXPRESSION(ReferenceExpression)
PER_EXPRESSION(TextureOpExpression)
PER_EXPRESSION(TexturePtrExpression)
PER_EXPRESSION(GetElementExpression)

0 comments on commit 1e6dd97

Please sign in to comment.