26 inline namespace _V1 {
58 std::mutex *CacheMutex);
78 cl_kernel
get()
const {
80 return pi::cast<cl_kernel>(MKernel);
89 template <
typename Param>
typename Param::return_type
get_info()
const;
94 template <
typename Param>
102 template <
typename Param>
112 template <
typename Param>
116 template <
typename Param>
138 const PluginPtr &Plugin = MContext->getPlugin();
157 return MNoncacheableEnqueueMutex;
167 bool MCreatedFromSource =
true;
170 bool MIsInterop =
false;
171 std::mutex MNoncacheableEnqueueMutex;
173 std::mutex *MCacheMutex =
nullptr;
175 bool isBuiltInKernel(
const device &Device)
const;
176 void checkIfValidForNumArgsInfoQuery()
const;
179 template <
typename Param>
182 "Invalid kernel information descriptor");
183 if constexpr (std::is_same_v<Param, info::kernel::num_args>)
184 checkIfValidForNumArgsInfoQuery();
190 inline context kernel_impl::get_info<info::kernel::context>()
const {
191 return createSyclObjFromImpl<context>(MContext);
194 template <
typename Param>
195 inline typename Param::return_type
197 if constexpr (std::is_same_v<
198 Param, info::kernel_device_specific::global_work_size>) {
201 if (!isDeviceCustom && !isBuiltInKernel(Device))
204 "info::kernel_device_specific::global_work_size descriptor may only "
205 "be used if the device type is device_type::custom or if the kernel "
206 "is a built-in kernel.");
209 return get_kernel_device_specific_info<Param>(
214 template <
typename Param>
215 inline typename Param::return_type
218 return get_kernel_device_specific_info_with_input<Param>(
227 ext::oneapi::experimental::info::kernel_queue_specific::
228 max_num_work_group_sync>(
const queue &Queue)
const {
230 const auto &Handle = getHandleRef();
231 const auto MaxWorkGroupSize =
232 Queue.get_device().get_info<info::device::max_work_group_size>();
235 Handle, MaxWorkGroupSize, 0, &GroupCount);
The context class represents a SYCL context on which kernel functions may be executed.
kernel_impl(sycl::detail::pi::PiKernel Kernel, ContextImplPtr Context, KernelBundleImplPtr KernelBundleImpl, const KernelArgMask *ArgMask=nullptr)
Constructs a SYCL kernel instance from a PiKernel.
kernel_impl(const kernel_impl &)=delete
const KernelArgMask * getKernelArgMask() const
kernel_impl & operator=(const kernel_impl &)=delete
sycl::detail::pi::PiKernel & getHandleRef()
Get a reference to a raw kernel object.
kernel_impl & operator=(kernel_impl &&)=delete
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...
std::mutex & getNoncacheableEnqueueMutex()
PiProgram getProgramRef() const
kernel_impl(kernel_impl &&)=delete
ContextImplPtr getContextImplPtr() const
bool isCreatedFromSource() const
Check if kernel was created from a program that had been created from source.
const PluginPtr & getPlugin() const
pi_native_handle getNative() const
const sycl::detail::pi::PiKernel & getHandleRef() const
Get a constant reference to a raw kernel object.
Param::return_type get_info() const
Query information from the kernel object using the info::kernel_info descriptor.
const DeviceImageImplPtr & getDeviceImage() const
Param::return_type get_backend_info() const
Queries the kernel object for SYCL backend-specific information.
KernelBundleImplPtr get_kernel_bundle() const
cl_kernel get() const
Gets a valid OpenCL kernel handle.
Param::return_type ext_oneapi_get_info(const queue &q) const
std::mutex * getCacheMutex() const
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
detail::is_device_info_desc< Param >::return_type get_info() const
Queries this SYCL device for information requested by the template parameter param.
Encapsulates a single SYCL queue which schedules kernels on a SYCL device.
std::shared_ptr< device_image_impl > DeviceImageImplPtr
decltype(Obj::impl) const & getSyclObjImpl(const Obj &SyclObject)
std::vector< bool > KernelArgMask
std::shared_ptr< sycl::detail::context_impl > ContextImplPtr
static const PluginPtr & getPlugin(backend Backend)
std::shared_ptr< plugin > PluginPtr
std::shared_ptr< detail::kernel_bundle_impl > KernelBundleImplPtr
sycl::detail::kernel_bundle_impl kernel_bundle_impl
std::error_code make_error_code(sycl::errc E) noexcept
Constructs an error code using e and sycl_category()
uintptr_t pi_native_handle
pi_result piKernelRetain(pi_kernel kernel)
pi_result piextKernelSuggestMaxCooperativeGroupCount(pi_kernel kernel, size_t local_work_size, size_t dynamic_shared_memory_size, pi_uint32 *group_count_ret)
Gets the max work group count for a cooperative kernel.
pi_result piextKernelGetNativeHandle(pi_kernel kernel, pi_native_handle *nativeHandle)
Gets the native handle of a PI kernel object.
C++ wrapper of extern "C" PI interfaces.