DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::ext::codeplay::experimental::fusion_wrapper Class Reference

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...
 

Detailed Description

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 30 of file fusion_wrapper.hpp.

Constructor & Destructor Documentation

◆ fusion_wrapper()

sycl::_V1::ext::codeplay::experimental::fusion_wrapper::fusion_wrapper ( queue q)
explicit

Wrap a queue to get access to the kernel fusion API.

Exceptions
sycl::exceptionwith errc::invalid if trying to construct a wrapper on a queue which doesn't support fusion.

Definition at line 18 of file fusion_wrapper.cpp.

References sycl::_V1::queue::ext_codeplay_supports_fusion(), and sycl::_V1::detail::getSyclObjImpl().

Member Function Documentation

◆ cancel_fusion()

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 38 of file fusion_wrapper.cpp.

◆ complete_fusion()

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().

Parameters
propertiesProperties to take into account when performing fusion.

Definition at line 40 of file fusion_wrapper.cpp.

◆ get_queue()

queue sycl::_V1::ext::codeplay::experimental::fusion_wrapper::get_queue ( ) const

Access the queue wrapped by this fusion wrapper.

Definition at line 28 of file fusion_wrapper.cpp.

◆ is_in_fusion_mode()

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 32 of file fusion_wrapper.cpp.

◆ start_fusion()

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.

Exceptions
sycl::exceptionwith errc::invalid if this operation is called on a queue which is already in fusion mode.

Definition at line 36 of file fusion_wrapper.cpp.


The documentation for this class was generated from the following files: