[llvm] [libsycl] implement methods of synchronization in event and queue classes (PR #205860)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 7 14:49:50 PDT 2026
================
@@ -18,4 +19,24 @@ exception_list::iterator exception_list::begin() const { return MList.begin(); }
exception_list::iterator exception_list::end() const { return MList.cend(); }
+void detail::addAsyncException(exception_list &List,
+ const std::exception_ptr &Exception) {
+ List.MList.emplace_back(Exception);
+}
+
+void detail::defaultAsyncHandler(exception_list Exceptions) {
+ std::cerr << "Default async_handler caught exceptions:";
+ for (auto &EIt : Exceptions) {
+ try {
+ if (EIt) {
+ std::rethrow_exception(EIt);
+ }
+ } catch (const std::exception &E) {
----------------
Robertkq wrote:
In the unit tests added for async handler, we are explicitly catching like this:
```cpp
catch (const sycl::exception &E)
```
-- and any other type of exception is not expected
Would it make sense for the default async handler to also expect only `sycl::exception`s?
https://github.com/llvm/llvm-project/pull/205860
More information about the llvm-commits
mailing list