![]() |
Shamrock 2025.10.0
Astrophysical Code
|
A SYCL queue associated with a device and a context. More...
#include <shambackends/include/shambackends/DeviceQueue.hpp>
Collaboration diagram for sham::DeviceQueue:Public Member Functions | |
| DeviceQueue (std::string queue_name, std::shared_ptr< DeviceContext > ctx, bool in_order) | |
| Create a device queue. | |
| template<class Fct > | |
| sycl::event | submit (Fct &&fct) |
| Submits a kernel to the SYCL queue. | |
| template<class Fct > | |
| sycl::event | submit (EventList &elist, Fct &&fct) |
| Submits a kernel to the SYCL queue, adding the events in the provided EventList as dependencies. | |
| DeviceProperties & | get_device_prop () |
| Retrieves the properties of the associated device. | |
Public Attributes | |
| std::shared_ptr< DeviceContext > | ctx |
| The device context of this queue. | |
| sycl::queue | q |
| The SYCL queue associated with this context. | |
| std::string | queue_name |
| The name of this queue. | |
| bool | in_order |
| Whether the queue is in order. | |
| bool | wait_after_submit = false |
| Whether to wait for the kernel to finish after submitting it. | |
A SYCL queue associated with a device and a context.
This class represents a SYCL queue. The queue is used to schedule kernels on the device and to transfer data between the host and the device.
Definition at line 32 of file DeviceQueue.hpp.
| sham::DeviceQueue::DeviceQueue | ( | std::string | queue_name, |
| std::shared_ptr< DeviceContext > | ctx, | ||
| bool | in_order | ||
| ) |
Create a device queue.
| queue_name | The name of the queue |
| ctx | The device context of the queue |
| in_order | Whether the queue is in order |
Create a device queue with the given name, device context and order property.
Definition at line 46 of file DeviceQueue.cpp.
|
inline |
Retrieves the properties of the associated device.
This function returns the properties of the device associated with the current device context. It fetches the device properties from the context reference and provides details such as vendor, backend, memory capacity, and other device-specific characteristics.
Definition at line 165 of file DeviceQueue.hpp.
Here is the call graph for this function:
|
inline |
Submits a kernel to the SYCL queue, adding the events in the provided EventList as dependencies.
This function submits a kernel, encapsulated within the provided functor, to the SYCL queue for execution. The functor is expected to take a sycl::handler as its argument and use it to define the kernel operations.
The events in the EventList are added as dependencies to the submitted kernel. This allows to create a dependency graph between kernels and events, which can be used to coordinate the execution of kernels.
| Fct | The type of the functor |
| elist | The EventList containing the events to be added as dependencies |
| fct | The functor that defines the kernel to be executed |
If the wait_after_submit flag is true, this function will wait for the kernel to finish and will throw any exceptions that occur during execution.
Definition at line 139 of file DeviceQueue.hpp.
Here is the call graph for this function:
|
inline |
Submits a kernel to the SYCL queue.
This function submits a kernel, encapsulated within the provided functor, to the SYCL queue for execution. The functor is expected to take a sycl::handler as its argument and use it to define the kernel operations.
| Fct | The type of the functor |
| fct | The functor that defines the kernel to be executed |
If the wait_after_submit flag is true, this function will wait for the kernel to finish and will throw any exceptions that occur during execution.
Definition at line 101 of file DeviceQueue.hpp.
| std::shared_ptr<DeviceContext> sham::DeviceQueue::ctx |
The device context of this queue.
Definition at line 37 of file DeviceQueue.hpp.
| bool sham::DeviceQueue::in_order |
Whether the queue is in order.
This is true if the queue is in order, false otherwise. If the queue is in order, the kernels are executed in the order they are enqueued, otherwise the kernels are executed using a DAG.
Definition at line 59 of file DeviceQueue.hpp.
| sycl::queue sham::DeviceQueue::q |
The SYCL queue associated with this context.
Definition at line 42 of file DeviceQueue.hpp.
| std::string sham::DeviceQueue::queue_name |
The name of this queue.
This is the name of this queue. It is used to identify the queue in logs and debug messages.
Definition at line 50 of file DeviceQueue.hpp.
| bool sham::DeviceQueue::wait_after_submit = false |
Whether to wait for the kernel to finish after submitting it.
This is true if the queue should wait for the kernel to finish after submitting it, false otherwise.
This is never enabled by default but is set on based on the env flag SHAMROCK_WAIT_AFTER_SUBMIT.
Definition at line 70 of file DeviceQueue.hpp.