[llvm] [Offload] Don't create events for empty queues (PR #152304)

Callum Fare via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 06:16:00 PDT 2025


================
@@ -939,6 +939,14 @@ struct GenericDeviceTy : public DeviceAllocatorTy {
   Error printInfo();
   virtual Expected<InfoTreeNode> obtainInfoImpl() = 0;
 
+  /// Return true if the device has work that is either queued or currently
+  /// running
+  ///
+  /// Devices which cannot report this information should always return true
----------------
callumfare wrote:

We could use this to implement the equivalent of the `UR_QUEUE_INFO_EMPTY` query. If that's the case though, returning `true` when the device doesn't support the query would be misleading. It could return an error that gets safely handled in `olCreateEvent_impl` instead.

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


More information about the llvm-commits mailing list