Skip to content

Commit

Permalink
LoadStoreOp can have scalar inputs, so type check is required
Browse files Browse the repository at this point in the history
  • Loading branch information
naoyam committed Nov 6, 2024
1 parent 967c282 commit c7e1345
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions csrc/scheduler/cache_policy_refiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ bool isLoadGlobalToLocal(const Expr* expr) {
if (ldst->opType() != LoadStoreOpType::Set) {
return false;
}
// It should not be necessary to check the output since it should be
// always a TensorView as long as the input is a TensorView, but
// just in case.
if (!ldst->in()->isA<TensorView>() || !ldst->out()->isA<TensorView>()) {
return false;
}
if (ldst->in()->as<TensorView>()->getMemoryType() != MemoryType::Global) {
return false;
}
Expand Down

0 comments on commit c7e1345

Please sign in to comment.