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

#include <detail/kernel_impl.hpp>

Public Member Functions

 kernel_impl (sycl::detail::pi::PiKernel Kernel, ContextImplPtr Context, KernelBundleImplPtr KernelBundleImpl, const KernelArgMask *ArgMask=nullptr)
 Constructs a SYCL kernel instance from a PiKernel. More...
 
 kernel_impl (sycl::detail::pi::PiKernel Kernel, ContextImplPtr ContextImpl, ProgramImplPtr ProgramImpl, bool IsCreatedFromSource, KernelBundleImplPtr KernelBundleImpl, const KernelArgMask *ArgMask)
 Constructs a SYCL kernel instance from a SYCL program and a PiKernel. More...
 
 kernel_impl (sycl::detail::pi::PiKernel Kernel, ContextImplPtr ContextImpl, DeviceImageImplPtr DeviceImageImpl, KernelBundleImplPtr KernelBundleImpl, const KernelArgMask *ArgMask, PiProgram ProgramPI, std::mutex *CacheMutex)
 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 PluginPtrgetPlugin () const
 
template<typename Param >
Param::return_type get_info () const
 Query information from the kernel object using the info::kernel_info descriptor. More...
 
template<typename Param >
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<typename Param >
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
 
sycl::detail::pi::PiKernelgetHandleRef ()
 Get a reference to a raw kernel object. More...
 
const sycl::detail::pi::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
 
PiProgram getProgramRef () const
 
ContextImplPtr getContextImplPtr () const
 
std::mutex & getNoncacheableEnqueueMutex ()
 
const KernelArgMaskgetKernelArgMask () const
 
std::mutex * getCacheMutex () const
 
template<typename Param >
Param::return_type get_info (const device &Device, const sycl::range< 3 > &WGSize) const
 

Detailed Description

Definition at line 36 of file kernel_impl.hpp.

Constructor & Destructor Documentation

◆ kernel_impl() [1/6]

sycl::_V1::detail::kernel_impl::kernel_impl ( sycl::detail::pi::PiKernel  Kernel,
ContextImplPtr  Context,
KernelBundleImplPtr  KernelBundleImpl,
const KernelArgMask ArgMask = nullptr 
)

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 getPlugin(), PI_TRUE, PI_USM_INDIRECT_ACCESS, and piKernelSetExecInfo().

◆ kernel_impl() [2/6]

sycl::_V1::detail::kernel_impl::kernel_impl ( sycl::detail::pi::PiKernel  Kernel,
ContextImplPtr  ContextImpl,
ProgramImplPtr  ProgramImpl,
bool  IsCreatedFromSource,
KernelBundleImplPtr  KernelBundleImpl,
const KernelArgMask ArgMask 
)

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 getPlugin(), PI_KERNEL_INFO_CONTEXT, and piKernelGetInfo().

◆ kernel_impl() [3/6]

sycl::_V1::detail::kernel_impl::kernel_impl ( sycl::detail::pi::PiKernel  Kernel,
ContextImplPtr  ContextImpl,
DeviceImageImplPtr  DeviceImageImpl,
KernelBundleImplPtr  KernelBundleImpl,
const KernelArgMask ArgMask,
PiProgram  ProgramPI,
std::mutex *  CacheMutex 
)

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 61 of file kernel_impl.cpp.

◆ kernel_impl() [4/6]

sycl::_V1::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 74 of file kernel_impl.cpp.

◆ kernel_impl() [5/6]

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

◆ kernel_impl() [6/6]

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

◆ ~kernel_impl()

sycl::_V1::detail::kernel_impl::~kernel_impl ( )

Definition at line 77 of file kernel_impl.cpp.

References getPlugin(), is_host(), and piKernelRelease().

Member Function Documentation

◆ ext_oneapi_get_info()

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

◆ get()

cl_kernel sycl::_V1::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 105 of file kernel_impl.hpp.

References getPlugin(), is_host(), and piKernelRetain().

◆ get_info() [1/4]

template<typename Param >
Param::return_type sycl::_V1::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 211 of file kernel_impl.hpp.

References getHandleRef(), getPlugin(), and is_host().

◆ get_info() [2/4]

template<typename Param >
Param::return_type sycl::_V1::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 232 of file kernel_impl.hpp.

References sycl::_V1::info::custom, sycl::_V1::device::get_info(), getHandleRef(), getPlugin(), sycl::_V1::detail::getSyclObjImpl(), sycl::_V1::invalid, and is_host().

◆ get_info() [3/4]

template<typename Param >
Param::return_type sycl::_V1::detail::kernel_impl::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.

◆ get_info() [4/4]

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

◆ get_kernel_bundle()

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

Definition at line 180 of file kernel_impl.hpp.

◆ getCacheMutex()

std::mutex* sycl::_V1::detail::kernel_impl::getCacheMutex ( ) const
inline

Definition at line 192 of file kernel_impl.hpp.

◆ getContextImplPtr()

ContextImplPtr sycl::_V1::detail::kernel_impl::getContextImplPtr ( ) const
inline

Definition at line 185 of file kernel_impl.hpp.

◆ getDeviceImage()

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

Definition at line 166 of file kernel_impl.hpp.

◆ getHandleRef() [1/2]

sycl::detail::pi::PiKernel& sycl::_V1::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 153 of file kernel_impl.hpp.

Referenced by get_info().

◆ getHandleRef() [2/2]

const sycl::detail::pi::PiKernel& sycl::_V1::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 158 of file kernel_impl.hpp.

◆ getKernelArgMask()

const KernelArgMask* sycl::_V1::detail::kernel_impl::getKernelArgMask ( ) const
inline

Definition at line 191 of file kernel_impl.hpp.

◆ getNative()

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

◆ getNoncacheableEnqueueMutex()

std::mutex& sycl::_V1::detail::kernel_impl::getNoncacheableEnqueueMutex ( )
inline

Definition at line 187 of file kernel_impl.hpp.

◆ getPlugin()

const PluginPtr& sycl::_V1::detail::kernel_impl::getPlugin ( ) const
inline

Definition at line 120 of file kernel_impl.hpp.

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

◆ getProgramRef()

PiProgram sycl::_V1::detail::kernel_impl::getProgramRef ( ) const
inline

Definition at line 184 of file kernel_impl.hpp.

◆ is_host()

bool sycl::_V1::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 118 of file kernel_impl.hpp.

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

◆ isCreatedFromSource()

bool sycl::_V1::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 sycl::_V1::detail::kernel_impl::isInterop ( ) const
inline

Definition at line 182 of file kernel_impl.hpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

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