DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::kernel_bundle< State > Class Template Reference

The kernel_bundle class represents collection of device images in a particular state. More...

#include <sycl/kernel.hpp>

Public Types

using device_image_iterator = const device_image< State > *
 

Public Member Functions

 kernel_bundle ()=delete
 
bool empty () const noexcept
 
backend get_backend () const noexcept
 
context get_context () const noexcept
 
std::vector< deviceget_devices () const noexcept
 
bool has_kernel (const kernel_id &KernelID) const noexcept
 
bool has_kernel (const kernel_id &KernelID, const device &Dev) const noexcept
 
template<typename KernelName >
bool has_kernel () const noexcept
 
template<typename KernelName >
bool has_kernel (const device &Dev) const noexcept
 
std::vector< kernel_idget_kernel_ids () const
 
bool contains_specialization_constants () const noexcept
 
bool native_specialization_constant () const noexcept
 
template<bundle_state _State = State, typename = std::enable_if_t<_State == bundle_state::executable>>
kernel get_kernel (const kernel_id &KernelID) const
 
template<typename KernelName , bundle_state _State = State, typename = std::enable_if_t<_State == bundle_state::executable>>
kernel get_kernel () const
 
template<auto & SpecName>
bool has_specialization_constant () const noexcept
 
template<auto & SpecName, bundle_state _State = State, typename = std::enable_if_t<_State == bundle_state::input>>
void set_specialization_constant (typename std::remove_reference_t< decltype(SpecName)>::value_type Value)
 Sets the value of the specialization constant whose address is SpecName for this bundle. More...
 
template<auto & SpecName>
std::remove_reference_t< decltype(SpecName)>::value_type get_specialization_constant () const
 
device_image_iterator begin () const
 
device_image_iterator end () const
 

Friends

template<class T >
detail::createSyclObjFromImpl (decltype(T::impl) ImplObj)
 
template<backend Backend, bundle_state StateB>
auto get_native (const kernel_bundle< StateB > &Obj) -> backend_return_t< Backend, kernel_bundle< StateB >>
 

Detailed Description

template<bundle_state State>
class sycl::_V1::kernel_bundle< State >

The kernel_bundle class represents collection of device images in a particular state.

Definition at line 32 of file kernel.hpp.

Member Typedef Documentation

◆ device_image_iterator

template<bundle_state State>
using sycl::_V1::kernel_bundle< State >::device_image_iterator = const device_image<State> *

Definition at line 213 of file kernel_bundle.hpp.

Constructor & Destructor Documentation

◆ kernel_bundle()

template<bundle_state State>
sycl::_V1::kernel_bundle< State >::kernel_bundle ( )
delete

Member Function Documentation

◆ begin()

template<bundle_state State>
device_image_iterator sycl::_V1::kernel_bundle< State >::begin ( ) const
inline
Returns
an iterator to the first device image kernel_bundle contains

Definition at line 334 of file kernel_bundle.hpp.

Referenced by sycl::_V1::detail::make_kernel().

◆ contains_specialization_constants()

template<bundle_state State>
bool sycl::_V1::kernel_bundle< State >::contains_specialization_constants ( ) const
inlinenoexcept
Returns
true if the kernel_bundle contains at least one device image which uses specialization constants

Definition at line 268 of file kernel_bundle.hpp.

◆ empty()

template<bundle_state State>
bool sycl::_V1::kernel_bundle< State >::empty ( ) const
inlinenoexcept
Returns
true if the kernel_bundles contains no device images

Definition at line 218 of file kernel_bundle.hpp.

◆ end()

template<bundle_state State>
device_image_iterator sycl::_V1::kernel_bundle< State >::end ( ) const
inline
Returns
an iterator to the last device image kernel_bundle contains

Definition at line 340 of file kernel_bundle.hpp.

◆ get_backend()

template<bundle_state State>
backend sycl::_V1::kernel_bundle< State >::get_backend ( ) const
inlinenoexcept
Returns
the backend associated with the kernel bundle

Definition at line 221 of file kernel_bundle.hpp.

◆ get_context()

template<bundle_state State>
context sycl::_V1::kernel_bundle< State >::get_context ( ) const
inlinenoexcept
Returns
the context associated with the kernel_bundle

Definition at line 226 of file kernel_bundle.hpp.

Referenced by sycl::_V1::handler::use_kernel_bundle().

◆ get_devices()

template<bundle_state State>
std::vector<device> sycl::_V1::kernel_bundle< State >::get_devices ( ) const
inlinenoexcept
Returns
devices associated with the kernel_bundle

Definition at line 231 of file kernel_bundle.hpp.

◆ get_kernel() [1/2]

template<bundle_state State>
template<typename KernelName , bundle_state _State = State, typename = std::enable_if_t<_State == bundle_state::executable>>
kernel sycl::_V1::kernel_bundle< State >::get_kernel ( ) const
inline
Returns
a kernel object which represents the kernel identified by KernelName.

Definition at line 290 of file kernel_bundle.hpp.

◆ get_kernel() [2/2]

template<bundle_state State>
template<bundle_state _State = State, typename = std::enable_if_t<_State == bundle_state::executable>>
kernel sycl::_V1::kernel_bundle< State >::get_kernel ( const kernel_id KernelID) const
inline
Returns
a kernel object which represents the kernel identified by kernel_id passed

Definition at line 282 of file kernel_bundle.hpp.

◆ get_kernel_ids()

template<bundle_state State>
std::vector<kernel_id> sycl::_V1::kernel_bundle< State >::get_kernel_ids ( ) const
inline
Returns
a vector of kernel_id's that contained in the kernel_bundle

Definition at line 262 of file kernel_bundle.hpp.

◆ get_specialization_constant()

template<bundle_state State>
template<auto & SpecName>
std::remove_reference_t<decltype(SpecName)>::value_type sycl::_V1::kernel_bundle< State >::get_specialization_constant ( ) const
inline
Returns
the value of the specialization constant whose address is SpecName for this kernel bundle.

Definition at line 317 of file kernel_bundle.hpp.

◆ has_kernel() [1/4]

template<bundle_state State>
template<typename KernelName >
bool sycl::_V1::kernel_bundle< State >::has_kernel ( ) const
inlinenoexcept
Returns
true only if the kernel bundle contains the kernel identified by KernelName.

Definition at line 250 of file kernel_bundle.hpp.

◆ has_kernel() [2/4]

template<bundle_state State>
template<typename KernelName >
bool sycl::_V1::kernel_bundle< State >::has_kernel ( const device Dev) const
inlinenoexcept
Returns
true only if the kernel bundle contains the kernel identified by KernelName and if that kernel is compatible with the device Dev.

Definition at line 257 of file kernel_bundle.hpp.

◆ has_kernel() [3/4]

template<bundle_state State>
bool sycl::_V1::kernel_bundle< State >::has_kernel ( const kernel_id KernelID) const
inlinenoexcept
Returns
true if the kernel_bundle contains the kernel identified by kernel_id passed

Definition at line 237 of file kernel_bundle.hpp.

◆ has_kernel() [4/4]

template<bundle_state State>
bool sycl::_V1::kernel_bundle< State >::has_kernel ( const kernel_id KernelID,
const device Dev 
) const
inlinenoexcept
Returns
true if the kernel_bundle contains the kernel identified by kernel_id passed and if this kernel is compatible with the device specified

Definition at line 244 of file kernel_bundle.hpp.

◆ has_specialization_constant()

template<bundle_state State>
template<auto & SpecName>
bool sycl::_V1::kernel_bundle< State >::has_specialization_constant ( ) const
inlinenoexcept
Returns
true if any device image in the kernel_bundle uses specialization constant whose address is SpecName

Definition at line 296 of file kernel_bundle.hpp.

◆ native_specialization_constant()

template<bundle_state State>
bool sycl::_V1::kernel_bundle< State >::native_specialization_constant ( ) const
inlinenoexcept
Returns
true if all specialization constants which are used in the kernel_bundle are "native specialization constants in all device images

Definition at line 274 of file kernel_bundle.hpp.

◆ set_specialization_constant()

template<bundle_state State>
template<auto & SpecName, bundle_state _State = State, typename = std::enable_if_t<_State == bundle_state::input>>
void sycl::_V1::kernel_bundle< State >::set_specialization_constant ( typename std::remove_reference_t< decltype(SpecName)>::value_type  Value)
inline

Sets the value of the specialization constant whose address is SpecName for this bundle.

If the specialization constant’s value was previously set in this bundle, the value is overwritten.

Definition at line 306 of file kernel_bundle.hpp.

Friends And Related Function Documentation

◆ detail::createSyclObjFromImpl

template<bundle_state State>
template<class T >
T detail::createSyclObjFromImpl ( decltype(T::impl)  ImplObj)
friend

◆ get_native

template<bundle_state State>
template<backend Backend, bundle_state StateB>
auto get_native ( const kernel_bundle< StateB > &  Obj) -> backend_return_t< Backend, kernel_bundle< StateB >>
friend

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