[llvm] [Offload][omp] Use olGetDeviceInfo to get device info (PR #229693)

Alex Duran via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 00:52:10 PDT 2026


================
@@ -216,16 +213,11 @@ struct DeviceTy {
 
   /// Get information from the device.
   template <typename T> T getInfo(DeviceInfo Info) const {
-    InfoTreeNode DevInfo = RTL->obtain_device_info(RTLDeviceID);
-
-    auto EntryOpt = DevInfo.get(Info);
-    if (!EntryOpt)
-      return 0;
-
-    auto Entry = *EntryOpt;
-    if (!std::holds_alternative<T>(Entry->Value))
+    T Value{};
+    if (olGetDeviceInfo(DeviceHandle, static_cast<ol_device_info_t>(Info),
----------------
adurang wrote:

I'm getting contradictory opinions on this (https://github.com/llvm/llvm-project/pull/226442#discussion_r4196452665) so we probably should agree on one style :D

https://github.com/llvm/llvm-project/pull/229693


More information about the llvm-commits mailing list