[llvm] [OFFLOAD] Add olIterateCompatibleDevices API (PR #226441)

Kevin Sala Penades via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 21:55:42 PDT 2026


================
@@ -46,6 +46,21 @@ def olIsValidBinary : Function {
     let returns = [];
 }
 
+def olIterateCompatibleDevices : Function {
+    let desc = "Iterates over all available devices that are compatible with the binary image pointed to by `ProgData`, calling the callback for each device.";
+    let details = [
+        "The provided `ProgData` will not be loaded onto any device",
+        "If the user-provided callback returns `false`, the iteration is stopped."
+    ];
+    let params = [
+        Param<"const void*", "ProgData", "pointer to the program binary data", PARAM_IN>,
+        Param<"size_t", "ProgDataSize", "size of the program binary in bytes", PARAM_IN>,
+        Param<"ol_device_iterate_cb_t", "Callback", "User-provided function called for each compatible device", PARAM_IN>,
+        Param<"void*", "UserData", "Optional user data to pass to the callback", PARAM_IN_OPTIONAL>
----------------
kevinsala wrote:

```suggestion
        Param<"void*", "UserData", "optional user data to pass to the callback", PARAM_IN_OPTIONAL>
```

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


More information about the llvm-commits mailing list