Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 5, 2023
1 parent b39c382 commit 9597d86
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions taichi/transforms/scalarize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,10 @@ class ScalarizeLocalPointers : public BasicStmtVisitor {
// { original_alloca_stmt : [scalarized_alloca_stmt0, ...] }
std::unordered_map<Stmt *, std::vector<Stmt *>> scalarized_local_tensor_map_;

explicit ScalarizeLocalPointers(IRNode *node, const std::unordered_set<Stmt *> &scalarizable_allocas) : immediate_modifier_(node), scalarizable_allocas_(scalarizable_allocas) {
explicit ScalarizeLocalPointers(
IRNode *node,
const std::unordered_set<Stmt *> &scalarizable_allocas)
: immediate_modifier_(node), scalarizable_allocas_(scalarizable_allocas) {
node->accept(this);

delayed_modifier_.modify_ir();
Expand Down Expand Up @@ -636,7 +639,8 @@ class ScalarizeLocalPointers : public BasicStmtVisitor {
stmt->replace_all_usages_with(scalarized_alloca_stmt)
*/
void visit(MatrixPtrStmt *stmt) override {
if (stmt->origin->is<AllocaStmt>() && scalarizable_allocas_.count(stmt->origin) == 1) {
if (stmt->origin->is<AllocaStmt>() &&
scalarizable_allocas_.count(stmt->origin) == 1) {
auto alloca_stmt = stmt->origin->cast<AllocaStmt>();
auto tensor_type =
alloca_stmt->ret_type.ptr_removed()->cast<TensorType>();
Expand Down

0 comments on commit 9597d86

Please sign in to comment.