Skip to content

Commit f06a67e

Browse files
committed
Add chipset constant at beginning of file
1 parent 7c44f09 commit f06a67e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ constexpr Chipset kGfx908 = Chipset(9, 0, 8);
4343
constexpr Chipset kGfx90a = Chipset(9, 0, 0xa);
4444
constexpr Chipset kGfx942 = Chipset(9, 4, 2);
4545
constexpr Chipset kGfx950 = Chipset(9, 5, 0);
46+
constexpr Chipset kGfx1250 = Chipset(12, 5, 0);
4647

4748
/// Convert an unsigned number `val` to i32.
4849
static Value convertUnsignedToI32(ConversionPatternRewriter &rewriter,
@@ -1149,7 +1150,7 @@ static std::optional<StringRef> wmmaOpToIntrinsic(WMMAOp wmma,
11491150
k, isRDNA3);
11501151

11511152
// Handle gfx1250.
1152-
if (chipset == Chipset{12, 5, 0})
1153+
if (chipset == kGfx1250)
11531154
return wmmaOpToIntrinsicGfx1250(elemSourceType, elemBSourceType,
11541155
elemDestType, k);
11551156

@@ -1300,7 +1301,7 @@ struct WMMAOpLowering : public ConvertOpToLLVMPattern<WMMAOp> {
13001301
if (chipset.majorVersion != 11 && chipset.majorVersion != 12)
13011302
return op->emitOpError("WMMA only supported on gfx11 and gfx12");
13021303

1303-
bool isGFX1250 = chipset >= Chipset(12, 5, 0);
1304+
bool isGFX1250 = chipset >= kGfx1250;
13041305

13051306
// The WMMA operations represent vectors of bf16s as vectors of i16s
13061307
// (except on gfx1250), so we need to bitcast bfloats to i16 and then
@@ -1725,7 +1726,7 @@ LogicalResult ScaledExtPacked816OpLowering::matchAndRewrite(
17251726
using fp6 = Float6E2M3FNType;
17261727
using bf6 = Float6E3M2FNType;
17271728
Location loc = op.getLoc();
1728-
if (chipset != Chipset{12, 5, 0}) {
1729+
if (chipset != kGfx1250) {
17291730
return rewriter.notifyMatchFailure(
17301731
loc,
17311732
"Scaled fp packed conversion instructions are not available on target "

0 commit comments

Comments
 (0)