Skip to content

Commit

Permalink
Account for buffer lanes in predicate lane check
Browse files Browse the repository at this point in the history
Change-Id: I821210665e36c26bfa37fc9ed380b5d03c9e816e
  • Loading branch information
lhutton1 committed May 22, 2024
1 parent 941cd38 commit cbd2e48
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tir/ir/expr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,10 @@ BufferLoad::BufferLoad(Buffer buffer, Array<PrimExpr> indices, Optional<PrimExpr
ICHECK_EQ(is_index_scalable, is_predicate_scalable)
<< "Predicate mask dtype and load indices must both be scalable.";

int buffer_lanes = buffer->dtype.get_lanes_or_vscale_factor();
int index_lanes = indices.empty() ? 1 : indices.back().dtype().get_lanes_or_vscale_factor();
int predicate_lanes = predicate_dtype.get_lanes_or_vscale_factor();
ICHECK_EQ(index_lanes, predicate_lanes)
ICHECK_EQ(index_lanes * buffer_lanes, predicate_lanes)
<< "Got a predicate mask with " << predicate_lanes
<< " lanes, but trying to load a vector with " << index_lanes
<< " lanes. The number of lanes must match.";
Expand Down

0 comments on commit cbd2e48

Please sign in to comment.