[llvm] [offload][l0] Implement context groups and add actual L0 driver version to info (PR #217562)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 23:57:02 PDT 2026


Jan =?utf-8?q?Trusi=C5=82=C5=82o?= <jan.trusillo at intel.com>,
Jan =?utf-8?q?Trusi=C5=82=C5=82o?= <jan.trusillo at intel.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/217562 at github.com>


================
@@ -96,7 +73,15 @@ void discoverOffloadDevices() {
         if (OlBackend >= OL_PLATFORM_BACKEND_LAST)
           return true;
 
-        (*Data)[static_cast<size_t>(OlBackend)].push_back({Platform, Dev});
+        uint32_t ContextGroupIndex = 0;
+        Res = callNoCheck(olGetDeviceInfo, Dev,
+                          OL_DEVICE_INFO_CONTEXT_GROUP_INDEX,
+                          sizeof(ContextGroupIndex), &ContextGroupIndex);
+        if (Res != OL_SUCCESS)
+          ContextGroupIndex = 0;
+
+        (*Data)[static_cast<size_t>(OlBackend)].push_back(
+            {Platform, Dev, ContextGroupIndex});
----------------
Robertkq wrote:

nit: can (or should) we make this little bit prettier?

```suggestion
size_t index = static_cast<size_t>(OlBackend);
auto& container = *Data;
container[index].push_back(...);        
```

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


More information about the llvm-commits mailing list