DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::kernel Class Reference

Provides an abstraction of a SYCL kernel. More...

#include <sycl/kernel.hpp>

Inheritance diagram for sycl::_V1::kernel:
Collaboration diagram for sycl::_V1::kernel:

Public Member Functions

 kernel (const kernel &RHS)=default
 Constructs a SYCL kernel instance from an OpenCL cl_kernel. More...
 
 kernel (kernel &&RHS)=default
 
kerneloperator= (const kernel &RHS)=default
 
kerneloperator= (kernel &&RHS)=default
 
bool operator== (const kernel &RHS) const
 
bool operator!= (const kernel &RHS) const
 
context get_context () const
 Get a valid OpenCL kernel handle. More...
 
backend get_backend () const noexcept
 Returns the backend associated with this kernel. More...
 
kernel_bundle< bundle_state::executableget_kernel_bundle () const
 Get the kernel_bundle associated with this kernel. More...
 
template<typename Param >
detail::is_kernel_info_desc< Param >::return_type get_info () const
 Query information from the kernel object using the info::kernel_info descriptor. More...
 
template<typename Param >
detail::is_backend_info_desc< Param >::return_type get_backend_info () const
 Queries the kernel object for SYCL backend-specific information. More...
 
template<typename Param >
detail::is_kernel_device_specific_info_desc< Param >::return_type get_info (const device &Device) const
 Query device-specific information from the kernel object using the info::kernel_device_specific descriptor. More...
 
template<typename Param >
detail::is_kernel_device_specific_info_desc< Param >::return_type get_info (const device &Device, const range< 3 > &WGSize) const
 Query device-specific information from a kernel using the info::kernel_device_specific descriptor for a specific device and value. More...
 
template<typename Param >
Param::return_type ext_oneapi_get_info (const queue &q) const
 
- Public Member Functions inherited from sycl::_V1::detail::OwnerLessBase< kernel >
bool ext_oneapi_owner_before (const ext::oneapi::detail::weak_object_base< kernel > &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 &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 BackendName, class SyclObjectT >
auto get_native (const SyclObjectT &Obj) -> backend_return_t< BackendName, SyclObjectT >
 

Detailed Description

Provides an abstraction of a SYCL kernel.

See also
sycl_api_exec
program
queue

Definition at line 71 of file kernel.hpp.

Constructor & Destructor Documentation

◆ kernel() [1/2]

sycl::_V1::kernel::kernel ( const kernel RHS)
default

Constructs a SYCL kernel instance from an OpenCL cl_kernel.

The requirements for this constructor are described in section 4.3.1 of the SYCL specification.

Parameters
ClKernelis a valid OpenCL cl_kernel instance
SyclContextis a valid SYCL context

◆ kernel() [2/2]

sycl::_V1::kernel::kernel ( kernel &&  RHS)
default

Member Function Documentation

◆ ext_oneapi_get_info()

template<typename Param >
Param::return_type sycl::_V1::kernel::ext_oneapi_get_info ( const queue q) const

Definition at line 104 of file kernel.cpp.

◆ get_backend()

backend sycl::_V1::kernel::get_backend ( ) const
noexcept

Returns the backend associated with this kernel.

Returns
the backend associated with this kernel.

Definition at line 37 of file kernel.cpp.

References sycl::_V1::detail::getImplBackend().

◆ get_backend_info()

template<typename Param >
detail::is_backend_info_desc< Param >::return_type sycl::_V1::kernel::get_backend_info

Queries the kernel object for SYCL backend-specific information.

The return type depends on information being queried.

Definition at line 61 of file kernel.cpp.

◆ get_context()

context sycl::_V1::kernel::get_context ( ) const

Get a valid OpenCL kernel handle.

If this kernel encapsulates an instance of OpenCL kernel, a valid cl_kernel will be returned.

Returns
a valid cl_kernel instance Get the context that this kernel is defined for.

The value returned must be equal to that returned by get_info<info::kernel::context>().

Returns
a valid SYCL context

Definition at line 33 of file kernel.cpp.

References sycl::_V1::context::get_info().

◆ get_info() [1/3]

template<typename Param >
detail::is_kernel_info_desc<Param>::return_type sycl::_V1::kernel::get_info ( ) const
inline

Query information from the kernel object using the info::kernel_info descriptor.

Returns
depends on information being queried.

Definition at line 129 of file kernel.hpp.

References sycl::_V1::detail::convert_from_abi_neutral().

◆ get_info() [2/3]

template<typename Param >
detail::is_kernel_device_specific_info_desc< Param >::return_type sycl::_V1::kernel::get_info ( const device Device) const

Query device-specific information from the kernel object using the info::kernel_device_specific descriptor.

Parameters
Deviceis a valid SYCL device to query info for.
Returns
depends on information being queried.

Definition at line 75 of file kernel.cpp.

◆ get_info() [3/3]

template<typename Param >
detail::is_kernel_device_specific_info_desc< Param >::return_type sycl::_V1::kernel::get_info ( const device Device,
const range< 3 > &  WGSize 
) const

Query device-specific information from a kernel using the info::kernel_device_specific descriptor for a specific device and value.

max_sub_group_size is the only valid descriptor for this function.

Parameters
Deviceis a valid SYCL device.
WGSizeis the work-group size the sub-group size is requested for.
Returns
depends on information being queried.

Definition at line 83 of file kernel.cpp.

◆ get_kernel_bundle()

kernel_bundle< sycl::bundle_state::executable > sycl::_V1::kernel::get_kernel_bundle ( ) const

Get the kernel_bundle associated with this kernel.

Returns
a valid kernel_bundle<bundle_state::executable>

Definition at line 40 of file kernel.cpp.

References sycl::_V1::detail::createSyclObjFromImpl().

◆ operator!=()

bool sycl::_V1::kernel::operator!= ( const kernel RHS) const
inline

Definition at line 94 of file kernel.hpp.

◆ operator=() [1/2]

kernel& sycl::_V1::kernel::operator= ( const kernel RHS)
default

◆ operator=() [2/2]

kernel& sycl::_V1::kernel::operator= ( kernel &&  RHS)
default

◆ operator==()

bool sycl::_V1::kernel::operator== ( const kernel RHS) const
inline

Definition at line 92 of file kernel.hpp.

Friends And Related Function Documentation

◆ detail::createSyclObjFromImpl

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

◆ get_native

template<backend BackendName, class SyclObjectT >
auto get_native ( const SyclObjectT &  Obj) -> backend_return_t< BackendName, SyclObjectT >
friend

Definition at line 130 of file backend.hpp.


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