Skip to content

Commit 03a635f

Browse files
committed
Add BMG to the uArch.
1 parent c03de27 commit 03a635f

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

mlir/include/mlir/Dialect/XeGPU/Utils/IntelGpuPVC.h renamed to mlir/include/mlir/Dialect/XeGPU/Utils/IntelGpuXe2.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,50 @@ struct PVCuArch : public Xe2Plus {
172172
};
173173
} // namespace PVCuArch
174174

175+
namespace BMGuArch {
176+
struct BMGuArch : public Xe2Plus {
177+
// Maintaines ownership of the instructions owned by PVUarch
178+
std::vector<std::unique_ptr<Instruction>> owned_instructions;
179+
BMGuArch()
180+
: Xe2Plus("bmg", // archName
181+
"Battlemage Architecture", // archDescription
182+
XeCoreInfo(8, SharedMemory(256 * 1024, 4), 8, 8), // xeCore
183+
{/* register_file_info */}, // Optional: empty
184+
{/* cache_info */}, // Optional: empty
185+
{/* instructions */}, // Optional: empty
186+
{/* restrictions */} // Optional: empty
187+
) {
188+
// Initialize uArchHierarchy
189+
this->uArch_hierarchy.push_back(uArchHierarchyComponent("thread", 0));
190+
this->uArch_hierarchy.push_back(uArchHierarchyComponent("XeCore", 8));
191+
this->uArch_hierarchy.push_back(uArchHierarchyComponent("XeSlice", 4));
192+
this->uArch_hierarchy.push_back(uArchHierarchyComponent("XeStack", 5));
193+
this->uArch_hierarchy.push_back(uArchHierarchyComponent("gpu", 1));
194+
// Intialize register file info
195+
// GRF
196+
this->register_file_info["GRF"] =
197+
RegisterFileInfo(64 * 1024, // size in bits
198+
{"small", "large"}, // GRF modes
199+
{128, 256}, // registers per thread per mode
200+
0, // number of banks
201+
0 // bank size
202+
);
203+
// Initialize cache info
204+
// L1 cache, XeCore level
205+
this->cache_info.push_back(
206+
CacheInfo(256 * 1024, 64, this->uArch_hierarchy[1]));
207+
// L3 cache, XeStack level
208+
this->cache_info.push_back(
209+
CacheInfo(18 * 1024 * 1024, 256, this->uArch_hierarchy[3]));
210+
211+
// Add the instructions
212+
auto dpas = std::make_unique<DPASInstruction>();
213+
instructions[dpas->name] = dpas.get();
214+
owned_instructions.push_back(std::move(dpas));
215+
}
216+
};
217+
} // namespace BMGuArch
218+
175219
} // namespace Xe2Plus
176220
} // namespace uArch
177221
} // namespace xegpu

mlir/lib/Dialect/XeGPU/Utils/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
add_mlir_dialect_library(MLIRXeGPUUtils
2-
IntelGpuPVC.cpp
2+
IntelGpuXe2.cpp
33
XeGPUUtils.cpp
44

55

0 commit comments

Comments
 (0)