Skip to content

Commit bba25dd

Browse files
committed
Address review comments.
Simplify design: - Remove dialect initialization and necessary mechanism.
1 parent f33b7f7 commit bba25dd

File tree

3 files changed

+0
-61
lines changed

3 files changed

+0
-61
lines changed

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

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -199,51 +199,6 @@ struct SharedMemory {
199199
// @TODO: Add more fields as needed (e.g., latency, throughput, bandwidth)
200200
};
201201

202-
struct uArchMap {
203-
public:
204-
// Singleton instance
205-
static uArchMap &instance() {
206-
static uArchMap instance;
207-
return instance;
208-
}
209-
210-
// Insert or update a key-value pair
211-
void insert(const std::string &key, std::shared_ptr<uArch> value) {
212-
std::unique_lock<std::shared_mutex> lock(mutex_);
213-
// map_[key] = std::move(value); // safe to overwrite
214-
map_.emplace(key, std::move(value)); // safe to overwrite
215-
}
216-
217-
// Get a value by key (concurrent safe read)
218-
std::shared_ptr<uArch> get(const std::string &key) const {
219-
std::shared_lock<std::shared_mutex> lock(mutex_);
220-
auto it = map_.find(key);
221-
if (it != map_.end())
222-
return it->second;
223-
return nullptr;
224-
}
225-
226-
// Check if a key exists
227-
bool contains(const std::string &key) const {
228-
std::shared_lock<std::shared_mutex> lock(mutex_);
229-
return map_.find(key) != map_.end();
230-
}
231-
232-
// Remove a key
233-
bool erase(const std::string &key) {
234-
std::unique_lock<std::shared_mutex> lock(mutex_);
235-
return map_.erase(key) > 0;
236-
}
237-
238-
private:
239-
uArchMap() = default;
240-
uArchMap(const uArchMap &) = delete;
241-
uArchMap &operator=(const uArchMap &) = delete;
242-
243-
mutable std::shared_mutex mutex_;
244-
std::map<std::string, std::shared_ptr<uArch>> map_;
245-
};
246-
247202
} // namespace uArch
248203
} // namespace xegpu
249204
} // namespace mlir

mlir/lib/Dialect/LLVMIR/IR/XeVMDialect.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,6 @@ XeVMTargetAttr::verify(function_ref<InFlightDiagnostic()> emitError, int O,
381381
}
382382

383383
void XeVMDialect::initialize() {
384-
// Populate the uArchMap with the supported target devices
385-
auto pvcuArch =
386-
std::make_shared<mlir::xegpu::uArch::Xe2Plus::PVCuArch::PVCuArch>();
387-
mlir::xegpu::uArch::uArchMap::instance().insert("pvc", pvcuArch);
388-
auto bmguArch =
389-
std::make_shared<mlir::xegpu::uArch::Xe2Plus::BMGuArch::BMGuArch>();
390-
mlir::xegpu::uArch::uArchMap::instance().insert("bmg", bmguArch);
391-
392384
addOperations<
393385
#define GET_OP_LIST
394386
#include "mlir/Dialect/LLVMIR/XeVMOps.cpp.inc"

mlir/lib/Dialect/XeGPU/IR/XeGPUDialect.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ void XeGPUDialect::initialize() {
3636
#define GET_ATTRDEF_LIST
3737
#include <mlir/Dialect/XeGPU/IR/XeGPUAttrs.cpp.inc>
3838
>();
39-
40-
// Populate the uArchMap with the supported target devices
41-
auto pvcuArch =
42-
std::make_shared<mlir::xegpu::uArch::Xe2Plus::PVCuArch::PVCuArch>();
43-
mlir::xegpu::uArch::uArchMap::instance().insert("pvc", pvcuArch);
44-
auto bmguArch =
45-
std::make_shared<mlir::xegpu::uArch::Xe2Plus::BMGuArch::BMGuArch>();
46-
mlir::xegpu::uArch::uArchMap::instance().insert("bmg", bmguArch);
4739
}
4840

4941
/// Generates instructions to compute offsets for a subgroup identified by

0 commit comments

Comments
 (0)