[llvm] [Offload] Add `MAX_WORK_GROUP_SIZE` device info query (PR #143718)
Callum Fare via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 11 08:24:43 PDT 2025
================
@@ -247,11 +244,50 @@ Error olGetDeviceInfoImplDetail(ol_device_handle_t Device,
DevInfo.getQueue().end(), InfoKeyMatches);
if (Item != std::end(DevInfo.getQueue())) {
- return Item->Value;
+ return Item;
}
}
- return std::string("");
+ return std::nullopt;
+ };
+ auto GetInfoString = [&](std::vector<std::string> Names) {
+ InfoQueueTy DevInfo;
+
+ if (auto Item = FindInfo(DevInfo, Names)) {
+ return (*Item)->Value.c_str();
+ } else {
+ return "";
+ }
+ };
+ auto GetInfoXyz = [&](std::vector<std::string> Names) {
----------------
callumfare wrote:
This looks correct, but also shows that the way the plugins handle device info right now isn't ideal. A refactor in the near future would be good, perhaps eliminating the nesting levels and differing names for the same property ('HSA Runtime Version' vs 'CUDA driver version' etc).
Feels like formatting and printing of the info should happen at a higher level in `libomptarget` or `llvm-offload-device-info`.
https://github.com/llvm/llvm-project/pull/143718
More information about the llvm-commits
mailing list