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

Inheritance diagram for sycl::_V1::kernel_bundle< State >:
Collaboration diagram for sycl::_V1::kernel_bundle< State >:

Public Types

using device_image_iterator = const device_image< State > *
 

Public Member Functions

 kernel_bundle ()=delete
 
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
bool empty () const noexcept
 
backend get_backend () const noexcept
 
context get_context () const noexcept
 
std::vector< deviceget_devices () const noexcept
 
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
bool has_kernel (const kernel_id &KernelID) const noexcept
 
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
bool has_kernel (const kernel_id &KernelID, const device &Dev) const noexcept
 
template<typename KernelName , bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
bool has_kernel () const noexcept
 
template<typename KernelName , bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
bool has_kernel (const device &Dev) const noexcept
 
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
std::vector< kernel_idget_kernel_ids () const
 
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
bool contains_specialization_constants () const noexcept
 
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
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, bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
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, bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
std::remove_reference_t< decltype(SpecName)>::value_type get_specialization_constant () const
 
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
device_image_iterator begin () const
 
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
device_image_iterator end () const
 
template<bundle_state _State = State, typename = std::enable_if_t<_State == bundle_state::executable>>
bool ext_oneapi_has_kernel (const std::string &name)
 
template<bundle_state _State = State, typename = std::enable_if_t<_State == bundle_state::executable>>
kernel ext_oneapi_get_kernel (const std::string &name)
 
- Public Member Functions inherited from sycl::_V1::detail::kernel_bundle_plain
 kernel_bundle_plain (const detail::KernelBundleImplPtr &Impl)
 
bool operator== (const kernel_bundle_plain &RHS) const
 
bool operator!= (const kernel_bundle_plain &RHS) const
 
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
 
std::vector< kernel_idget_kernel_ids () const
 
bool contains_specialization_constants () const noexcept
 
bool native_specialization_constant () const noexcept
 
bool ext_oneapi_has_kernel (const std::string &name)
 
kernel ext_oneapi_get_kernel (const std::string &name)
 
- Public Member Functions inherited from sycl::_V1::detail::OwnerLessBase< kernel_bundle< State > >
bool ext_oneapi_owner_before (const ext::oneapi::detail::weak_object_base< kernel_bundle< State > > &Other) const noexcept
 Compares the object against a weak object using an owner-based implementation-defined ordering. More...
 
bool ext_oneapi_owner_before (const kernel_bundle< State > &Other) const noexcept
 Compares the object against another object using an owner-based implementation-defined ordering. More...
 

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

Additional Inherited Members

- Protected Member Functions inherited from sycl::_V1::detail::kernel_bundle_plain
kernel get_kernel (const kernel_id &KernelID) const
 
const device_image_plainbegin () const
 
const device_image_plainend () const
 
bool has_specialization_constant_impl (const char *SpecName) const noexcept
 
void set_specialization_constant_impl (const char *SpecName, void *Value, size_t Size) noexcept
 
void get_specialization_constant_impl (const char *SpecName, void *Value) const noexcept
 
bool is_specialization_constant_set (const char *SpecName) const noexcept
 
- Protected Attributes inherited from sycl::_V1::detail::kernel_bundle_plain
detail::KernelBundleImplPtr impl
 

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 223 of file kernel_bundle.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 226 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>
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
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 380 of file kernel_bundle.hpp.

References sycl::_V1::detail::kernel_bundle_plain::begin().

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

◆ contains_specialization_constants()

template<bundle_state State>
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
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 303 of file kernel_bundle.hpp.

References sycl::_V1::detail::kernel_bundle_plain::contains_specialization_constants().

◆ empty()

template<bundle_state State>
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
bool sycl::_V1::kernel_bundle< State >::empty ( ) const
inlinenoexcept
Returns
true if the kernel_bundles contains no device images

Definition at line 234 of file kernel_bundle.hpp.

References sycl::_V1::detail::kernel_bundle_plain::empty().

◆ end()

template<bundle_state State>
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
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 389 of file kernel_bundle.hpp.

References sycl::_V1::detail::kernel_bundle_plain::end().

◆ ext_oneapi_get_kernel()

template<bundle_state State>
template<bundle_state _State = State, typename = std::enable_if_t<_State == bundle_state::executable>>
kernel sycl::_V1::kernel_bundle< State >::ext_oneapi_get_kernel ( const std::string &  name)
inline

◆ ext_oneapi_has_kernel()

template<bundle_state State>
template<bundle_state _State = State, typename = std::enable_if_t<_State == bundle_state::executable>>
bool sycl::_V1::kernel_bundle< State >::ext_oneapi_has_kernel ( const std::string &  name)
inline

◆ 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 239 of file kernel_bundle.hpp.

References sycl::_V1::detail::kernel_bundle_plain::get_backend().

◆ 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 244 of file kernel_bundle.hpp.

References sycl::_V1::detail::kernel_bundle_plain::get_context().

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 249 of file kernel_bundle.hpp.

References sycl::_V1::detail::kernel_bundle_plain::get_devices().

◆ 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 328 of file kernel_bundle.hpp.

References sycl::_V1::detail::kernel_bundle_plain::get_kernel().

◆ 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 320 of file kernel_bundle.hpp.

References sycl::_V1::detail::kernel_bundle_plain::get_kernel().

◆ get_kernel_ids()

template<bundle_state State>
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
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 294 of file kernel_bundle.hpp.

References sycl::_V1::detail::kernel_bundle_plain::get_kernel_ids().

◆ get_specialization_constant()

template<bundle_state State>
template<auto & SpecName, bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
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 360 of file kernel_bundle.hpp.

◆ has_kernel() [1/4]

template<bundle_state State>
template<typename KernelName , bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
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 277 of file kernel_bundle.hpp.

◆ has_kernel() [2/4]

template<bundle_state State>
template<typename KernelName , bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
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 286 of file kernel_bundle.hpp.

◆ has_kernel() [3/4]

template<bundle_state State>
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
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 258 of file kernel_bundle.hpp.

References sycl::_V1::detail::kernel_bundle_plain::has_kernel().

◆ has_kernel() [4/4]

template<bundle_state State>
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
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 268 of file kernel_bundle.hpp.

References sycl::_V1::detail::kernel_bundle_plain::has_kernel().

◆ has_specialization_constant()

template<bundle_state State>
template<auto & SpecName, bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
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 337 of file kernel_bundle.hpp.

◆ native_specialization_constant()

template<bundle_state State>
template<bundle_state _State = State, typename = std::enable_if_t<_State != bundle_state::ext_oneapi_source>>
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 312 of file kernel_bundle.hpp.

References sycl::_V1::detail::kernel_bundle_plain::native_specialization_constant().

◆ 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 347 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: