[llvm] [Offload] Implement the remaining initial Offload API (PR #122106)

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 5 08:24:55 PST 2025


================
@@ -34,6 +34,69 @@ struct ol_platform_handle_t_ {
   std::vector<ol_device_handle_t_> Devices;
 };
 
+struct ol_queue_handle_t_ {
+  __tgt_async_info *AsyncInfo;
+  ol_device_handle_t Device;
+  std::atomic_uint32_t RefCount;
+};
+
+struct ol_event_handle_t_ {
+  void *EventInfo;
+  ol_queue_handle_t Queue;
+  ol_device_handle_t Device;
----------------
jdoerfert wrote:

I'm not sure, but I'm afraid these levels of indirection and duplication might cause a problem at some point. Some of it is also not clear to me. The device associated with a queue cannot change, why do we need a device_handle_t that adds a level of indirection (or is it expected to be flattened later)? For an event, why do we need a Device member that is already in Queue (and I don't think ever used)?

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


More information about the llvm-commits mailing list