Skip to content

Commit

Permalink
[AMD] Fix clang warnings in AMD backend. (triton-lang#4031)
Browse files Browse the repository at this point in the history
These changes are not necessary for OpenAI's build setup, but they are
marginal improvements. We are interested in merging those to simplify
our integration process.
  • Loading branch information
chsigg authored May 29, 2024
1 parent d527c3f commit 284f292
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct DotOpMFMAConversionHelper {
}

int getNumSubmatrices(Type elementType, int mDim, int nDim) const {
if (mDim == 64 && nDim == 4 || mDim == 4 && nDim == 64)
if ((mDim == 64 && nDim == 4) || (mDim == 4 && nDim == 64))
return 1;
assert(mDim == nDim);
switch (mDim) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ struct FpToFpOpConversion
if (srcMap.count(key) == 0) {
return mlir::failure();
}
return mlir::FailureOr(srcMap.lookup(key));
return srcMap.lookup(key);
}

SmallVector<Value> createDestOps(triton::FpToFpOp op, OpAdaptor adaptor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ struct LoadStoreConversionBase {
}

protected:
ModuleAxisInfoAnalysis &axisAnalysisPass;
const AMD::TargetInfo &targetInfo;
ModuleAxisInfoAnalysis &axisAnalysisPass;
};

struct LoadOpConversion : public ConvertOpToLLVMPattern<triton::LoadOp>,
Expand Down
2 changes: 1 addition & 1 deletion third_party/amd/lib/TritonAMDGPUToLLVM/TargetInfo.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "TargetInfo.h"
#include "TritonAMDGPUToLLVM/GCNAsmFormat.h"
#include "Utility.h"
#include "amd/include/TritonAMDGPUToLLVM/GCNAsmFormat.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "triton/Conversion/TritonGPUToLLVM/Utility.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class BlockedToMFMA : public mlir::RewritePattern {
// in mfma 4x4 case argument matrix groups in 16 groups
if (mDim == 4 && nDim == 4)
kWidth = kDim / 16;
if (mDim == 4 && nDim == 64 || mDim == 64 && nDim == 4)
if ((mDim == 4 && nDim == 64) || (mDim == 64 && nDim == 4))
kWidth = kDim;

// We want to extend kWidth by kPack (kPack=1 means no extension)
Expand Down

0 comments on commit 284f292

Please sign in to comment.