[llvm] [Offload] Implement the remaining initial Offload API (PR #122106)
Callum Fare via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 8 09:31:17 PDT 2025
================
@@ -104,3 +104,15 @@ def : Function {
Return<"OL_ERRC_INVALID_DEVICE">
];
}
+
+def : Function {
+ let name = "olGetHostDevice";
----------------
callumfare wrote:
Right, yeah we talked about avoiding that overhead previously. I think that's another argument to keep platforms as they are just now - a user can filter out platforms with backends they don't want with that callback mechanism (e.g. avoid the platform that reports `OL_PLATFORM_BACKEND_CUDA`). They can then do the same on the devices returned from that platform (e.g. filter out `OL_DEVICE_TYPE_CPU`). That means we can avoid the overhead associated with both steps.
With a flat list of devices we have the issue that we might not know the number of devices and their types until after the runtime is initialized. For example a future OpenCL plugin will need to initialize the OpenCL runtime (in fact likely the OpenCL ICD Loader and multiple runtimes) before knowing about what devices are available to iterate over.
https://github.com/llvm/llvm-project/pull/122106
More information about the llvm-commits
mailing list