Skip to content

Commit 6dace4b

Browse files
committed
Address review comments.
1 parent b417561 commit 6dace4b

File tree

3 files changed

+22
-46
lines changed

3 files changed

+22
-46
lines changed

mlir/include/mlir/Dialect/XeGPU/uArch/IntelGpuXe2.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
//===--- IntelGpuXe2.h ---------------------------------------*- C++ -*-===//
1+
//===--- IntelGpuXe2.h ------------------------------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
/// \file
10-
/// Xe2 uArch definition.
11-
///
9+
// \file
10+
// Xe2 uArch definition. Xe2 is the second generation of Intel Xe GPUs.
11+
// This file defines the uArch details for Xe2 and its derived architectures.
12+
// This includes Ponte Vecchio (PVC) and Battlemage (BMG) architectures.
1213
//
1314
//===----------------------------------------------------------------------===//
14-
#ifndef MLIR_DIALECT_XEGPU_UARCH_INTEL_GPU_XE2_H
15-
#define MLIR_DIALECT_XEGPU_UARCH_INTEL_GPU_XE2_H
15+
#ifndef MLIR_DIALECT_XEGPU_UARCH_INTELGPUXE2_H
16+
#define MLIR_DIALECT_XEGPU_UARCH_INTELGPUXE2_H
1617

1718
#include "mlir/Dialect/XeGPU/uArch/uArchInterfaces.h"
1819
#include "mlir/IR/BuiltinTypes.h"
@@ -179,4 +180,4 @@ struct BMGuArch : public Xe2Plus {
179180
} // namespace xegpu
180181
} // namespace mlir
181182

182-
#endif // MLIR_DIALECT_XEGPU_UARCH_INTEL_GPU_XE2_H
183+
#endif // MLIR_DIALECT_XEGPU_UARCH_INTELGPUXE2H

mlir/include/mlir/Dialect/XeGPU/uArch/uArchBase.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
//===--- uArch.h ---------------------------------------*- C++ -*-===//
1+
//===--- uArch.h ------------------------------------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
/// \file
10-
/// Base uArch definition for different architectures.
11-
///
9+
// \file
10+
// Base uArch definition for different architectures.
11+
//
1212
//
1313
//===----------------------------------------------------------------------===//
14-
#ifndef MLIR_DIALECT_XEGPU_UARCH_BASE_H
15-
#define MLIR_DIALECT_XEGPU_UARCH_BASE_H
14+
#ifndef MLIR_DIALECT_XEGPU_UARCH_UARCHBASE_H
15+
#define MLIR_DIALECT_XEGPU_UARCH_UARCHBASE_H
1616

1717
#include <any>
1818
#include <functional>
@@ -263,4 +263,4 @@ struct uArchMap {
263263
} // namespace xegpu
264264
} // namespace mlir
265265

266-
#endif // MLIR_DIALECT_XEGPU_UARCH_BASE_H
266+
#endif // MLIR_DIALECT_XEGPU_UARCH_UARCHBASE_H

mlir/lib/Dialect/XeGPU/uArch/IntelGpuXe2.cpp

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include "mlir/Dialect/XeGPU/uArch/IntelGpuXe2.h"
22
#include "mlir/IR/BuiltinTypes.h"
3-
#include "llvm/Support/YAMLTraits.h"
3+
#include "llvm/Support/DebugLog.h"
44
#include <algorithm>
5-
#include <iostream>
6-
#include <string>
75
#include <vector>
86

7+
#define DEBUG_TYPE "xegpu-uarch"
8+
99
using namespace mlir::xegpu::uArch;
1010
using namespace mlir::xegpu::uArch::Xe2Plus;
1111

@@ -80,51 +80,26 @@ bool DPASInstruction::checkSupportedTypes(mlir::Type AType, mlir::Type BType,
8080
if (AType.isF16() || BType.isF16()) {
8181
if (AType != BType || (CType && (!CType.isF32() && !CType.isF16())) ||
8282
(!DType.isF32() && !DType.isF16())) {
83-
llvm::errs()
84-
<< "Unsupported dpas combinations of Dst, Acc, A and B matrices, "
85-
<< "Supported types are:\n"
86-
<< " Dst | Acc | A | B \n"
87-
<< " f, hf | f, hf | hf | hf \n"
88-
<< "AType: " << AType << " BType: " << BType << " CType: " << CType
89-
<< " DType: " << DType;
83+
LDBG() << "Unsupported dpas combinations of Dst, Acc, A and B matrices.";
9084
return false;
9185
}
9286
} else if (AType.isBF16() || BType.isBF16()) {
9387
if (AType != BType || (CType && (!CType.isF32() && !CType.isBF16())) ||
9488
(!DType.isF32() && !DType.isBF16())) {
95-
llvm::errs()
96-
<< "Unsupported dpas combinations of Dst, Acc, A and B matrices, "
97-
<< "Supported types are:\n"
98-
<< " Dst | Acc | A | B \n"
99-
<< " f, bf | f, bf | bf | bf \n"
100-
<< "AType: " << AType << " BType: " << BType << " CType: " << CType
101-
<< " DType: " << DType;
89+
LDBG() << "Unsupported dpas combinations of Dst, Acc, A and B matrices.";
10290
return false;
10391
}
10492
} else if (AType.isTF32() || BType.isTF32()) {
10593
if (AType != BType || (CType && (!CType.isF32() && !DType.isF32())) ||
10694
(!DType.isF32())) {
107-
llvm::errs()
108-
<< "Unsupported dpas combinations of Dst, Acc, A and B matrices, "
109-
<< "Supported types are:\n"
110-
<< " Dst | Acc | A | B \n"
111-
<< " f | f | tf32 | tf32 \n"
112-
<< "AType: " << AType << " BType: " << BType << " CType: " << CType
113-
<< " DType: " << DType;
95+
LDBG() << "Unsupported dpas combinations of Dst, Acc, A and B matrices.";
11496
return false;
11597
}
11698
} else if (!(AType.isInteger(2) || AType.isInteger(4) ||
11799
AType.isInteger(8)) &&
118100
!(BType.isInteger(2) || BType.isInteger(4) ||
119101
BType.isInteger(8))) {
120-
llvm::errs()
121-
<< "Unsupported dpas combinations of Dst, Acc, A and B matrices, "
122-
<< "Supported types are:\n"
123-
<< " Dst | Acc | A | B "
124-
" \n"
125-
<< " ud, d | ud,d | ub,b,u4,s4,u2,s2 | ub,b,u4,s4,u2,s2 "
126-
<< "AType: " << AType << " BType: " << BType << " CType: " << CType
127-
<< " DType: " << DType;
102+
LDBG() << "Unsupported dpas combinations of Dst, Acc, A and B matrices.";
128103
return false;
129104
}
130105

0 commit comments

Comments
 (0)