Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/Traccc/device/sycl_utils/src/queue_wrapper.sycl is written in an unsupported language. File is not indexed.

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2022-2026 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 // Project include(s).
0009 #include "traccc/sycl/utils/queue_wrapper.hpp"
0010 
0011 // SYCL include(s).
0012 #include <sycl/sycl.hpp>
0013 namespace traccc::sycl {
0014 
0015 queue_wrapper::queue_wrapper(void* queue) : m_queue(queue) {}
0016 
0017 void* queue_wrapper::queue() {
0018   return m_queue;
0019 }
0020 
0021 const void* queue_wrapper::queue() const {
0022   return m_queue;
0023 }
0024 
0025 void queue_wrapper::enqueue_callback(std::function<void()> func) const {
0026   assert(m_queue != nullptr);
0027 
0028   auto& sycl_queue = *(reinterpret_cast<::sycl::queue*>(m_queue));
0029   sycl_queue.submit([func = std::move(func)](::sycl::handler& cgh) {
0030     cgh.host_task([func = std::move(func)]() { func(); });
0031   });
0032 }
0033 }  // namespace traccc::sycl