diff --git a/taichi/analysis/gen_offline_cache_key.cpp b/taichi/analysis/gen_offline_cache_key.cpp index 65b4063f49179..fc49776add690 100644 --- a/taichi/analysis/gen_offline_cache_key.cpp +++ b/taichi/analysis/gen_offline_cache_key.cpp @@ -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(block->statements.size())); diff --git a/taichi/inc/expressions.inc.h b/taichi/inc/expressions.inc.h index b311e6fb5a441..eaf498ea9598e 100644 --- a/taichi/inc/expressions.inc.h +++ b/taichi/inc/expressions.inc.h @@ -24,3 +24,4 @@ PER_EXPRESSION(MeshIndexConversionExpression) PER_EXPRESSION(ReferenceExpression) PER_EXPRESSION(TextureOpExpression) PER_EXPRESSION(TexturePtrExpression) +PER_EXPRESSION(GetElementExpression)