Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jokeren committed Aug 9, 2024
1 parent 593e5fa commit 5e017fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Dialect/TritonGPU/IR/LinearLayoutConversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ LinearLayout ensureLayoutNotLargerThan(
for (auto [inDimName, basis] : bases) {
for (size_t baseIdx = 0; baseIdx < basis.size(); baseIdx++) {
auto outValue = basis[baseIdx][outDim.index()];
if (outValue == 0)
if (outValue == 0) {
continue;
}
assert(llvm::isPowerOf2_32(outValue));
sortedBases.emplace_back(inDimName, baseIdx, outValue);
}
Expand All @@ -177,8 +178,9 @@ LinearLayout ensureLayoutNotLargerThan(
llvm::sort(sortedBases,
[](auto a, auto b) { return std::get<2>(a) > std::get<2>(b); });
for (auto [inDimName, basisIdx, outValue] : sortedBases) {
if (actualSize <= desiredSize)
if (actualSize <= desiredSize) {
break;
}
bases[inDimName][basisIdx][outDim.index()] = 0;
actualSize >>= 1;
}
Expand Down

0 comments on commit 5e017fb

Please sign in to comment.