[llvm] [libsycl] implement methods of synchronization in event and queue classes (PR #205860)

Kseniya Tikhomirova via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 05:49:15 PDT 2026


================
@@ -46,6 +53,31 @@ std::vector<std::unique_ptr<PlatformImpl>> &getPlatformCache();
 // the SYCL shared library is first being unloaded.
 void registerStaticVarShutdownHandler();
 
+// TODO: extend with context
+using AsyncExceptionKey = std::weak_ptr<QueueImpl>;
+
+struct AsyncExceptionKeyOwnerLess {
+  bool operator()(const AsyncExceptionKey &LHS,
+                  const AsyncExceptionKey &RHS) const noexcept {
+    return std::owner_less<std::weak_ptr<QueueImpl>>{}(LHS, RHS);
+  }
+};
+
+using AsyncExceptionsContainer =
+    std::map<AsyncExceptionKey, exception_list, AsyncExceptionKeyOwnerLess>;
----------------
KseniyaTikhomirova wrote:

unordered_map requires not only keyEqual rule than but also to provide hash function. 
`std::unordered_map<Key,T,Hash,KeyEqual,Allocator>::unordered_map`
map is fully satisfied with comparator:
`std::map<Key,T,Compare,Allocator>::map`

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


More information about the llvm-commits mailing list