Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-26 08:05:42

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2026 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 // Local include(s).
0009 #include "traccc/examples/sycl/tbb_await.hpp"
0010 
0011 // TBB include(s).
0012 #include <tbb/task.h>
0013 
0014 namespace traccc::sycl {
0015 void tbb_await_callback(vecmem::abstract_event& event,
0016                         const queue_wrapper& queue) {
0017   event.ignore();  // ignore the event, as it is not needed for resumption
0018   tbb::task::suspend([&queue](auto suspend_point) {
0019     queue.enqueue_callback(
0020         [suspend_point]() { tbb::task::resume(suspend_point); });
0021     // Exceptions thrown by a function passed to tbb::task::suspend occur
0022     // before the actual suspension, so the exception does not cause a deadlock.
0023   });
0024 }
0025 }  // namespace traccc::sycl