17 inline namespace _V1 {
20 : impl(
std::make_shared<detail::kernel_impl>(
25 if (get_backend() == backend::opencl) {
27 detail::pi::cast<sycl::detail::pi::PiKernel>(ClKernel));
31 cl_kernel
kernel::get()
const {
return impl->get(); }
33 bool kernel::is_host()
const {
34 bool IsHost = impl->is_host();
35 assert(!IsHost &&
"kernel::is_host should not be called in implementation.");
40 return impl->
get_info<info::kernel::context>();
51 template <
typename Param>
53 kernel::get_info_impl()
const {
57 #define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, PiCode) \
58 template __SYCL_EXPORT detail::ABINeutralT_t<ReturnT> \
59 kernel::get_info_impl<info::kernel::Desc>() const;
61 #include <sycl/info/kernel_traits.def>
63 #undef __SYCL_PARAM_TRAITS_SPEC
65 template <
typename Param>
66 typename detail::is_backend_info_desc<Param>::return_type
67 kernel::get_backend_info()
const {
68 return impl->get_backend_info<Param>();
71 #define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, Picode) \
72 template __SYCL_EXPORT ReturnT \
73 kernel::get_backend_info<info::DescType::Desc>() const;
75 #include <sycl/info/sycl_backend_traits.def>
77 #undef __SYCL_PARAM_TRAITS_SPEC
79 template <
typename Param>
81 kernel::get_info(
const device &Dev)
const {
82 return impl->get_info<Param>(Dev);
87 template <
typename Param>
91 std::is_same_v<Param, info::kernel_device_specific::max_sub_group_size>,
92 "Unexpected param for kernel::get_info with range argument.");
93 return impl->get_info<Param>(Device, WGSize);
96 #define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, PiCode) \
97 template __SYCL_EXPORT ReturnT kernel::get_info<info::DescType::Desc>( \
98 const device &) const;
100 #include <sycl/info/kernel_device_specific_traits.def>
102 #undef __SYCL_PARAM_TRAITS_SPEC
104 template __SYCL_EXPORT uint32_t
105 kernel::get_info<info::kernel_device_specific::max_sub_group_size>(
108 template <
typename Param>
109 typename Param::return_type
110 kernel::ext_oneapi_get_info(
const queue &Queue)
const {
111 return impl->ext_oneapi_get_info<Param>(Queue);
114 template __SYCL_EXPORT
typename ext::oneapi::experimental::info::
115 kernel_queue_specific::max_num_work_group_sync::return_type
116 kernel::ext_oneapi_get_info<
117 ext::oneapi::experimental::info::kernel_queue_specific::
118 max_num_work_group_sync>(
const queue &Queue)
const;
120 kernel::kernel(std::shared_ptr<detail::kernel_impl> Impl) : impl(Impl) {}
124 pi_native_handle kernel::getNativeImpl()
const {
return impl->getNative(); }
The context class represents a SYCL context on which kernel functions may be executed.
detail::is_context_info_desc< Param >::return_type get_info() const
Constructs a SYCL context instance from OpenCL cl_context.
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
The kernel_bundle class represents collection of device images in a particular state.
kernel(const kernel &RHS)=default
Constructs a SYCL kernel instance from an OpenCL cl_kernel.
Encapsulates a single SYCL queue which schedules kernels on a SYCL device.
constexpr tuple_element< I, tuple< Types... > >::type & get(sycl::detail::tuple< Types... > &Arg) noexcept
PiProgram cast(cl_program)=delete
auto convert_to_abi_neutral(ParamT &&Info)
backend getImplBackend(const T &Impl)
decltype(Obj::impl) getSyclObjImpl(const Obj &SyclObject)
T createSyclObjFromImpl(decltype(T::impl) ImplObj)
typename ABINeutralT< T >::type ABINeutralT_t
kernel_bundle< State > get_kernel_bundle(const context &Ctx, const std::vector< device > &Devs)
A kernel bundle in state State which contains all of the kernels in the application which are compati...
uintptr_t pi_native_handle
pi_result piKernelRetain(pi_kernel kernel)
_Abi const simd< _Tp, _Abi > & noexcept