DPC++ Runtime
Runtime libraries for oneAPI DPC++
cl::sycl::detail::kernel_impl Class Reference

#include <detail/kernel_impl.hpp>

Public Member Functions

 kernel_impl (RT::PiKernel Kernel, ContextImplPtr Context, KernelBundleImplPtr KernelBundleImpl)
 Constructs a SYCL kernel instance from a PiKernel. More...
 
 kernel_impl (RT::PiKernel Kernel, ContextImplPtr ContextImpl, ProgramImplPtr ProgramImpl, bool IsCreatedFromSource, KernelBundleImplPtr KernelBundleImpl)
 Constructs a SYCL kernel instance from a SYCL program and a PiKernel. More...
 
 kernel_impl (RT::PiKernel Kernel, ContextImplPtr ContextImpl, DeviceImageImplPtr DeviceImageImpl, KernelBundleImplPtr KernelBundleImpl)
 Constructs a SYCL kernel_impl instance from a SYCL device_image, kernel_bundle and / PiKernel. More...
 
 kernel_impl (ContextImplPtr Context, ProgramImplPtr ProgramImpl)
 Constructs a SYCL kernel for host device. More...
 
 kernel_impl (const kernel_impl &)=delete
 
 kernel_impl (kernel_impl &&)=delete
 
kernel_imploperator= (const kernel_impl &)=delete
 
kernel_imploperator= (kernel_impl &&)=delete
 
 ~kernel_impl ()
 
cl_kernel get () const
 Gets a valid OpenCL kernel handle. More...
 
bool is_host () const
 Check if the associated SYCL context is a SYCL host context. More...
 
const plugingetPlugin () const
 
template<info::kernel param>
info::param_traits< info::kernel, param >::return_type get_info () const
 Query information from the kernel object using the info::kernel_info descriptor. 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 a 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_work_group param>
info::param_traits< info::kernel_work_group, param >::return_type get_work_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) const
 Query sub-group information from a kernel using the info::kernel_sub_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...
 
RT::PiKernelgetHandleRef ()
 Get a reference to a raw kernel object. More...
 
const RT::PiKernelgetHandleRef () const
 Get a constant reference to a raw kernel object. More...
 
bool isCreatedFromSource () const
 Check if kernel was created from a program that had been created from source. More...
 
const DeviceImageImplPtrgetDeviceImage () const
 
pi_native_handle getNative () const
 
KernelBundleImplPtr get_kernel_bundle () const
 
bool isInterop () const
 

Detailed Description

Definition at line 34 of file kernel_impl.hpp.

Constructor & Destructor Documentation

◆ kernel_impl() [1/6]

cl::sycl::detail::kernel_impl::kernel_impl ( RT::PiKernel  Kernel,
ContextImplPtr  Context,
KernelBundleImplPtr  KernelBundleImpl 
)

Constructs a SYCL kernel instance from a PiKernel.

This constructor is used for plug-in interoperability. It always marks kernel as being created from source and creates a new program_impl instance.

Parameters
Kernelis a valid PiKernel instance
Contextis a valid SYCL context
KernelBundleImplis a valid instance of kernel_bundle_impl

Definition at line 20 of file kernel_impl.cpp.

References cl::sycl::detail::plugin::call(), getPlugin(), PI_TRUE, PI_USM_INDIRECT_ACCESS, piKernelRetain(), and piKernelSetExecInfo().

◆ kernel_impl() [2/6]

cl::sycl::detail::kernel_impl::kernel_impl ( RT::PiKernel  Kernel,
ContextImplPtr  ContextImpl,
ProgramImplPtr  ProgramImpl,
bool  IsCreatedFromSource,
KernelBundleImplPtr  KernelBundleImpl 
)

Constructs a SYCL kernel instance from a SYCL program and a PiKernel.

This constructor creates a new instance from PiKernel and saves the provided SYCL program. If context of PiKernel differs from context of the SYCL program, an invalid_parameter_error exception is thrown.

Parameters
Kernelis a valid PiKernel instance
ContextImplis a valid SYCL context
ProgramImplis a valid instance of program_impl
IsCreatedFromSourceis a flag that indicates whether program is created from source code
KernelBundleImplis a valid instance of kernel_bundle_impl

Definition at line 38 of file kernel_impl.cpp.

References cl::sycl::detail::plugin::call(), getPlugin(), PI_INVALID_CONTEXT, PI_KERNEL_INFO_CONTEXT, and piKernelGetInfo().

◆ kernel_impl() [3/6]

cl::sycl::detail::kernel_impl::kernel_impl ( RT::PiKernel  Kernel,
ContextImplPtr  ContextImpl,
DeviceImageImplPtr  DeviceImageImpl,
KernelBundleImplPtr  KernelBundleImpl 
)

Constructs a SYCL kernel_impl instance from a SYCL device_image, kernel_bundle and / PiKernel.

Parameters
Kernelis a valid PiKernel instance
ContextImplis a valid SYCL context
KernelBundleImplis a valid instance of kernel_bundle_impl

Definition at line 58 of file kernel_impl.cpp.

References cl::sycl::detail::plugin::call(), getPlugin(), is_host(), and piKernelRetain().

◆ kernel_impl() [4/6]

cl::sycl::detail::kernel_impl::kernel_impl ( ContextImplPtr  Context,
ProgramImplPtr  ProgramImpl 
)

Constructs a SYCL kernel for host device.

Parameters
Contextis a valid SYCL context
ProgramImplis a valid instance of program_impl

Definition at line 73 of file kernel_impl.cpp.

◆ kernel_impl() [5/6]

cl::sycl::detail::kernel_impl::kernel_impl ( const kernel_impl )
delete

◆ kernel_impl() [6/6]

cl::sycl::detail::kernel_impl::kernel_impl ( kernel_impl &&  )
delete

◆ ~kernel_impl()

cl::sycl::detail::kernel_impl::~kernel_impl ( )

Member Function Documentation

◆ get()

cl_kernel cl::sycl::detail::kernel_impl::get ( ) const
inline

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

Returns
a valid cl_kernel instance

Definition at line 99 of file kernel_impl.hpp.

References cl::sycl::detail::plugin::call(), cl::sycl::detail::pi::getPlugin(), PI_INVALID_KERNEL, and piKernelRetain().

◆ get_info() [1/3]

template<info::kernel param>
info::param_traits< info::kernel, param >::return_type cl::sycl::detail::kernel_impl::get_info
inline

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

Returns
depends on information being queried.

Definition at line 221 of file kernel_impl.hpp.

References std::get(), and cl::sycl::detail::pi::getPlugin().

◆ get_info() [2/3]

template<info::kernel_device_specific param>
info::param_traits< info::kernel_device_specific, param >::return_type cl::sycl::detail::kernel_impl::get_info ( const device Device) const
inline

Query device-specific information from a 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 246 of file kernel_impl.hpp.

References std::get(), cl::sycl::detail::pi::getPlugin(), and cl::sycl::detail::getSyclObjImpl().

◆ get_info() [3/3]

template<info::kernel_device_specific param>
info::param_traits< info::kernel_device_specific, param >::return_type cl::sycl::detail::kernel_impl::get_info ( const device Device,
typename info::param_traits< info::kernel_device_specific, param >::input_type  Value 
) const
inline

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

Parameters
Deviceis a valid SYCL device.
Valuedepends on information being queried.
Returns
depends on information being queried.

Definition at line 260 of file kernel_impl.hpp.

References std::get(), cl::sycl::detail::pi::getPlugin(), cl::sycl::detail::getSyclObjImpl(), and PI_INVALID_DEVICE.

◆ get_kernel_bundle()

KernelBundleImplPtr cl::sycl::detail::kernel_impl::get_kernel_bundle ( ) const
inline

Definition at line 205 of file kernel_impl.hpp.

◆ get_sub_group_info() [1/2]

template<info::kernel_sub_group param>
info::param_traits< info::kernel_sub_group, param >::return_type cl::sycl::detail::kernel_impl::get_sub_group_info ( const device Device) const
inline

Query sub-group information from a kernel using the info::kernel_sub_group descriptor for a specific device.

Parameters
Deviceis a valid SYCL device

Definition at line 283 of file kernel_impl.hpp.

◆ get_sub_group_info() [2/2]

template<info::kernel_sub_group param>
info::param_traits< info::kernel_sub_group, param >::return_type cl::sycl::detail::kernel_impl::get_sub_group_info ( const device Device,
typename info::param_traits< info::kernel_sub_group, param >::input_type  Value 
) const
inline

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

Parameters
Deviceis a valid SYCL device.
Valuedepends on information being queried.
Returns
depends on information being queried.

Definition at line 291 of file kernel_impl.hpp.

◆ get_work_group_info()

template<info::kernel_work_group param>
info::param_traits< info::kernel_work_group, param >::return_type cl::sycl::detail::kernel_impl::get_work_group_info ( const device Device) const
inline

Query work-group information from a kernel using the info::kernel_work_group descriptor for a specific device.

Parameters
Deviceis a valid SYCL device.
Returns
depends on information being queried.

Definition at line 275 of file kernel_impl.hpp.

◆ getDeviceImage()

const DeviceImageImplPtr& cl::sycl::detail::kernel_impl::getDeviceImage ( ) const
inline

Definition at line 191 of file kernel_impl.hpp.

◆ getHandleRef() [1/2]

RT::PiKernel& cl::sycl::detail::kernel_impl::getHandleRef ( )
inline

Get a reference to a raw kernel object.

Returns
a reference to a valid PiKernel instance with raw kernel object.

Definition at line 178 of file kernel_impl.hpp.

◆ getHandleRef() [2/2]

const RT::PiKernel& cl::sycl::detail::kernel_impl::getHandleRef ( ) const
inline

Get a constant reference to a raw kernel object.

Returns
a constant reference to a valid PiKernel instance with raw kernel object.

Definition at line 183 of file kernel_impl.hpp.

◆ getNative()

pi_native_handle cl::sycl::detail::kernel_impl::getNative ( ) const
inline

◆ getPlugin()

const plugin& cl::sycl::detail::kernel_impl::getPlugin ( ) const
inline

Definition at line 114 of file kernel_impl.hpp.

Referenced by kernel_impl(), and ~kernel_impl().

◆ is_host()

bool cl::sycl::detail::kernel_impl::is_host ( ) const
inline

Check if the associated SYCL context is a SYCL host context.

Returns
true if this SYCL kernel is a host kernel.

Definition at line 112 of file kernel_impl.hpp.

Referenced by kernel_impl(), and ~kernel_impl().

◆ isCreatedFromSource()

bool cl::sycl::detail::kernel_impl::isCreatedFromSource ( ) const

Check if kernel was created from a program that had been created from source.

Returns
true if kernel was created from source.

Definition at line 84 of file kernel_impl.cpp.

◆ isInterop()

bool cl::sycl::detail::kernel_impl::isInterop ( ) const
inline

Definition at line 207 of file kernel_impl.hpp.

◆ operator=() [1/2]

kernel_impl& cl::sycl::detail::kernel_impl::operator= ( const kernel_impl )
delete

◆ operator=() [2/2]

kernel_impl& cl::sycl::detail::kernel_impl::operator= ( kernel_impl &&  )
delete

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