Provides an abstraction of a SYCL kernel. More...
#include <CL/sycl/kernel.hpp>
Public Member Functions | |
kernel (const kernel &RHS)=default | |
Constructs a SYCL kernel instance from an OpenCL cl_kernel. More... | |
kernel (kernel &&RHS)=default | |
kernel & | operator= (const kernel &RHS)=default |
kernel & | operator= (kernel &&RHS)=default |
bool | operator== (const kernel &RHS) const |
bool | operator!= (const kernel &RHS) const |
bool | is_host () const |
Get a valid OpenCL kernel handle. More... | |
context | get_context () const |
Get the context that this kernel is defined for. More... | |
backend | get_backend () const noexcept |
Returns the backend associated with this kernel. More... | |
kernel_bundle< bundle_state::executable > | get_kernel_bundle () const |
Get the kernel_bundle associated with this kernel. More... | |
template<info::kernel param> | |
info::param_traits< info::kernel, param >::return_type | get_info () const |
Get the program that this kernel is defined for. More... | |
template<info::kernel_device_specific param> | |
info::param_traits< info::kernel_device_specific, 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<info::kernel_device_specific param> | |
info::param_traits< info::kernel_device_specific, param >::return_type | get_info (const device &Device, typename info::param_traits< info::kernel_device_specific, param >::input_type Value) const |
Query device-specific information from a kernel using the info::kernel_device_specific descriptor for a specific device and value. More... | |
template<info::kernel_sub_group param> | |
__SYCL2020_DEPRECATED("get_work_group_info() is deprecated, use SYCL 2020 " "kernel_device_specific queries instead") typename info info::param_traits< info::kernel_sub_group, param >::return_type | get_sub_group_info (const device &Device) const |
Query work-group information from a kernel using the info::kernel_work_group descriptor for a specific device. More... | |
template<info::kernel_sub_group param> | |
info::param_traits< info::kernel_sub_group, param >::return_type | get_sub_group_info (const device &Device, typename info::param_traits< info::kernel_sub_group, param >::input_type Value) const |
Query sub-group information from a kernel using the info::kernel_sub_group descriptor for a specific device and value. More... | |
template<backend Backend> | |
backend_return_t< Backend, kernel > | get_native () const |
template<info::kernel_sub_group param> | |
info::param_traits< info::kernel_sub_group, param >::return_type | get_sub_group_info (const device &dev) const |
Friends | |
template<class T > | |
T | detail::createSyclObjFromImpl (decltype(T::impl) ImplObj) |
Provides an abstraction of a SYCL kernel.
Definition at line 68 of file kernel.hpp.
|
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.
ClKernel | is a valid OpenCL cl_kernel instance |
SyclContext | is a valid SYCL context |
|
default |
|
noexcept |
Returns the backend associated with this kernel.
Definition at line 33 of file kernel.cpp.
References cl::sycl::detail::getImplBackend().
context cl::sycl::kernel::get_context | ( | ) | const |
Get the context that this kernel is defined for.
The value returned must be equal to that returned by get_info<info::kernel::context>().
Definition at line 29 of file kernel.cpp.
References cl::sycl::info::context.
info::param_traits< info::kernel, param >::return_type cl::sycl::kernel::get_info |
Get the program that this kernel is defined for.
The value returned must be equal to that returned by get_info<info::kernel::program>().
Definition at line 47 of file kernel.cpp.
info::param_traits< info::kernel_device_specific, param >::return_type cl::sycl::kernel::get_info | ( | const device & | Device | ) | const |
Query device-specific information from the kernel object using the info::kernel_device_specific descriptor.
Device | is a valid SYCL device to query info for. |
Definition at line 61 of file kernel.cpp.
info::param_traits< info::kernel_device_specific, param >::return_type cl::sycl::kernel::get_info | ( | const device & | Device, |
typename info::param_traits< info::kernel_device_specific, param >::input_type | Value | ||
) | const |
Query device-specific information from a kernel using the info::kernel_device_specific descriptor for a specific device and value.
Device | is a valid SYCL device. |
Value | depends on information being queried. |
Definition at line 67 of file kernel.cpp.
References Device.
kernel_bundle< sycl::bundle_state::executable > cl::sycl::kernel::get_kernel_bundle | ( | ) | const |
Get the kernel_bundle associated with this kernel.
Definition at line 36 of file kernel.cpp.
References cl::sycl::detail::createSyclObjFromImpl().
Referenced by cl::sycl::handler::parallel_for(), cl::sycl::handler::parallel_for_work_group(), and cl::sycl::handler::single_task().
|
inline |
Definition at line 206 of file kernel.hpp.
info::param_traits<info::kernel_sub_group, param>::return_type cl::sycl::kernel::get_sub_group_info | ( | const device & | dev | ) | const |
Definition at line 102 of file kernel.cpp.
__SYCL2020_DEPRECATED ("get_work_group_info() is deprecated, use SYCL 2020 " "kernel_device_specific queries instead") typename info info::param_traits<info::kernel_sub_group, param>::return_type cl::sycl::kernel::get_sub_group_info | ( | const device & | Device | ) | const |
Query work-group information from a kernel using the info::kernel_work_group descriptor for a specific device.
Device | is a valid SYCL device. |
Device | is a valid SYCL device. |
info::param_traits< info::kernel_sub_group, param >::return_type cl::sycl::kernel::get_sub_group_info | ( | const device & | Device, |
typename info::param_traits< info::kernel_sub_group, param >::input_type | Value | ||
) | const |
Query sub-group information from a kernel using the info::kernel_sub_group descriptor for a specific device and value.
Device | is a valid SYCL device. |
Value | depends on information being queried. |
Definition at line 108 of file kernel.cpp.
bool cl::sycl::kernel::is_host | ( | ) | const |
Get a valid OpenCL kernel handle.
If this kernel encapsulates an instance of OpenCL kernel, a valid cl_kernel will be returned. If this kernel is a host kernel, an invalid_object_error exception will be thrown.
Definition at line 27 of file kernel.cpp.
|
inline |
Definition at line 91 of file kernel.hpp.
References operator==().
|
inline |
Definition at line 89 of file kernel.hpp.
|
friend |