A wrapper wrapping a sycl::queue to provide access to the kernel fusion API, allowing to manage kernel fusion on the wrapped queue. More...
#include <sycl/ext/codeplay/experimental/fusion_wrapper.hpp>
Public Member Functions | |
fusion_wrapper (queue &q) | |
Wrap a queue to get access to the kernel fusion API. More... | |
queue | get_queue () const |
Access the queue wrapped by this fusion wrapper. More... | |
bool | is_in_fusion_mode () const |
Check whether the wrapped queue is in fusion mode or not. More... | |
void | start_fusion () |
Set the wrapped queue into "fusion mode". More... | |
void | cancel_fusion () |
Cancel the fusion and submit all kernels submitted since the last start_fusion() for immediate execution without fusion. More... | |
event | complete_fusion (const property_list &propList={}) |
Complete the fusion: JIT-compile a fused kernel from all kernels submitted to the wrapped queue since the last start_fusion and submit the fused kernel for execution. More... | |
A wrapper wrapping a sycl::queue to provide access to the kernel fusion API, allowing to manage kernel fusion on the wrapped queue.
Definition at line 28 of file fusion_wrapper.hpp.
|
explicit |
Wrap a queue to get access to the kernel fusion API.
sycl::exception | with errc::invalid if trying to construct a wrapper on a queue which doesn't support fusion. |
Definition at line 19 of file fusion_wrapper.cpp.
void sycl::_V1::ext::codeplay::experimental::fusion_wrapper::cancel_fusion | ( | ) |
Cancel the fusion and submit all kernels submitted since the last start_fusion() for immediate execution without fusion.
The kernels are executed in the same order as they were initially submitted to the wrapped queue.
This operation is asynchronous, i.e., it may return after the previously submitted kernels have been passed to the scheduler, but before any of the previously submitted kernel starts or completes execution. The events returned by submit() since the last call to start_fusion remain valid and can be used for synchronization.
The queue is not in "fusion mode" anymore after this calls returns, until the next start_fusion().
Definition at line 30 of file fusion_wrapper.cpp.
event sycl::_V1::ext::codeplay::experimental::fusion_wrapper::complete_fusion | ( | const property_list & | propList = {} | ) |
Complete the fusion: JIT-compile a fused kernel from all kernels submitted to the wrapped queue since the last start_fusion and submit the fused kernel for execution.
Inside the fused kernel, the per-work-item effects are executed in the same order as the kernels were initially submitted.
This operation is asynchronous, i.e., it may return after the JIT compilation is executed and the fused kernel is passed to the scheduler, but before the fused kernel starts or completes execution. The returned event allows to synchronize with the execution of the fused kernel. All events returned by queue::submit since the last call to start_fusion remain valid.
The wrapped queue is not in "fusion mode" anymore after this calls returns, until the next start_fusion().
properties | Properties to take into account when performing fusion. |
Definition at line 32 of file fusion_wrapper.cpp.
queue sycl::_V1::ext::codeplay::experimental::fusion_wrapper::get_queue | ( | ) | const |
Access the queue wrapped by this fusion wrapper.
Definition at line 22 of file fusion_wrapper.cpp.
bool sycl::_V1::ext::codeplay::experimental::fusion_wrapper::is_in_fusion_mode | ( | ) | const |
Check whether the wrapped queue is in fusion mode or not.
Definition at line 26 of file fusion_wrapper.cpp.
void sycl::_V1::ext::codeplay::experimental::fusion_wrapper::start_fusion | ( | ) |
Set the wrapped queue into "fusion mode".
This means that the kernels that are submitted in subsequent calls to queue::submit() are not submitted for execution right away, but rather added to a list of kernels that should be fused.
sycl::exception | with errc::invalid if this operation is called on a queue which is already in fusion mode. |
Definition at line 28 of file fusion_wrapper.cpp.