[llvm] [Offload] Implement the remaining initial Offload API (PR #122106)
Callum Fare via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 7 09:23:47 PDT 2025
================
@@ -104,3 +104,15 @@ def : Function {
Return<"OL_ERRC_INVALID_DEVICE">
];
}
+
+def : Function {
+ let name = "olGetHostDevice";
----------------
callumfare wrote:
After our discussion in the last call I think we were leaning to keeping the idea of a user-visible platform object rather than just a string or enum property of a device.
There are two ways I can think of doing this:
* Keep the API as is. A user explicitly iterates over platforms, and then fetches devices from those platforms. The platform is a handle that can be queried for information like vendor name etc. Users that don't care about the platforms can just iterate over all of them to get all devices. We would need to add a special host platform to contain the host device.
* Make devices the top-level object that the user interacts with. This essentially means that (as in libomptarget) the user iterates over a flat list of devices. There would still be a platform object that the user can query for from a device (using `olGetDeviceInfo`). This platform handle can then be queried for specific properties. We would need to add a special host platform to contain the host device, but it wouldn't really be user visible unless they go querying for it.
I slightly prefer the first option but I'm happy either way, it's just a small mechanical change in how the API is used to get to the list of available devices.
Is one of these options more preferable? Or is there a better way to go about this?
https://github.com/llvm/llvm-project/pull/122106
More information about the llvm-commits
mailing list