Skip to content

Commit

Permalink
Revert "Add back if-switch for quad ordering"
Browse files Browse the repository at this point in the history
This reverts commit 23599d1.
  • Loading branch information
ggengnv committed Oct 29, 2024
1 parent 23599d1 commit dceb453
Showing 1 changed file with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,24 +550,14 @@ Value composeValuesToDotOperandLayoutStruct(
const LLVMTypeConverter *typeConverter, Location loc,
ConversionPatternRewriter &rewriter, Type elTy, bool isHopper) {
std::vector<Value> elems;

// Existing convention for the ordering of quad values in llvm.struct
// is m-major for Hopper and k-major for Ampere, even though both Ampere
// and Hopper MMA's expect m-major ordering in PTX.
for (int b = 0; b < batch; ++b)
for (int m = 0; m < n0; ++m)
for (int k = 0; k < n1; ++k)
if (isHopper) {
elems.push_back(vals.at({b, 2 * m, 2 * k}));
elems.push_back(vals.at({b, 2 * m + 1, 2 * k}));
elems.push_back(vals.at({b, 2 * m, 2 * k + 1}));
elems.push_back(vals.at({b, 2 * m + 1, 2 * k + 1}));
} else {
elems.push_back(vals.at({b, 2 * m, 2 * k}));
elems.push_back(vals.at({b, 2 * m, 2 * k + 1}));
elems.push_back(vals.at({b, 2 * m + 1, 2 * k}));
elems.push_back(vals.at({b, 2 * m + 1, 2 * k + 1}));
}
for (int k = 0; k < n1; ++k) {
elems.push_back(vals.at({b, 2 * m, 2 * k}));
elems.push_back(vals.at({b, 2 * m + 1, 2 * k}));
elems.push_back(vals.at({b, 2 * m, 2 * k + 1}));
elems.push_back(vals.at({b, 2 * m + 1, 2 * k + 1}));
}
assert(!elems.empty());

if (isHopper) {
Expand Down

0 comments on commit dceb453

Please sign in to comment.