@@ -63,9 +63,103 @@ get_kernel_info(const queue &Q) {
6363 return get_kernel_info<KernelName, Param>(Q.get_context (), Q.get_device ());
6464}
6565
66- // For free functions.
6766namespace experimental {
6867
68+ // Param must be info::kernel::max_num_work_groups_sync.
69+ template <typename KernelName, typename Param,
70+ typename LaunchProperties = empty_properties_t >
71+ typename std::enable_if_t <
72+ std::is_same_v<Param, sycl::info::kernel::max_num_work_groups_sync>,
73+ typename Param::return_type>
74+ get_kernel_info (const context &ctxt, const device &dev, sycl::range<1 > r,
75+ LaunchProperties props = {}, size_t bytes = 0 ) {
76+ auto bundle =
77+ sycl::get_kernel_bundle<KernelName, sycl::bundle_state::executable>(ctxt);
78+ sycl::kernel k = bundle.template get_kernel <KernelName>();
79+ return k.ext_oneapi_get_info <Param>(dev, r, props, bytes);
80+ }
81+
82+ // Param must be info::kernel::max_num_work_groups_sync.
83+ template <typename KernelName, typename Param,
84+ typename LaunchProperties = empty_properties_t >
85+ typename std::enable_if_t <
86+ std::is_same_v<Param, sycl::info::kernel::max_num_work_groups_sync>,
87+ typename Param::return_type>
88+ get_kernel_info (const context &ctxt, const device &dev, sycl::range<2 > r,
89+ LaunchProperties props = {}, size_t bytes = 0 ) {
90+ auto bundle =
91+ sycl::get_kernel_bundle<KernelName, sycl::bundle_state::executable>(ctxt);
92+ sycl::kernel k = bundle.template get_kernel <KernelName>();
93+ return k.ext_oneapi_get_info <Param>(dev, r, props, bytes);
94+ }
95+
96+ // Param must be info::kernel::max_num_work_groups_sync.
97+ template <typename KernelName, typename Param,
98+ typename LaunchProperties = empty_properties_t >
99+ typename std::enable_if_t <
100+ std::is_same_v<Param, sycl::info::kernel::max_num_work_groups_sync>,
101+ typename Param::return_type>
102+ get_kernel_info (const context &ctxt, const device &dev, sycl::range<3 > r,
103+ LaunchProperties props = {}, size_t bytes = 0 ) {
104+ auto bundle =
105+ sycl::get_kernel_bundle<KernelName, sycl::bundle_state::executable>(ctxt);
106+ sycl::kernel k = bundle.template get_kernel <KernelName>();
107+ return k.ext_oneapi_get_info <Param>(dev, r, props, bytes);
108+ }
109+
110+ // Param must be info::kernel::max_num_work_groups_sync.
111+ template <typename KernelName, typename Param,
112+ typename LaunchProperties = empty_properties_t >
113+ typename std::enable_if_t <
114+ std::is_same_v<Param, sycl::info::kernel::max_num_work_groups_sync>,
115+ typename Param::return_type>
116+
117+ get_kernel_info (const queue &q, sycl::range<1 > r,
118+
119+ LaunchProperties props = {}, size_t bytes = 0 ) {
120+ sycl::context ctxt = q.get_context ();
121+ sycl::device dev = q.get_device ();
122+ auto bundle =
123+ sycl::get_kernel_bundle<KernelName, sycl::bundle_state::executable>(ctxt);
124+ sycl::kernel k = bundle.template get_kernel <KernelName>();
125+ return k.ext_oneapi_get_info <Param>(dev, r, props, bytes);
126+ }
127+
128+ // Param must be info::kernel::max_num_work_groups_sync.
129+ template <typename KernelName, typename Param,
130+ typename LaunchProperties = empty_properties_t >
131+ typename std::enable_if_t <
132+ std::is_same_v<Param, sycl::info::kernel::max_num_work_groups_sync>,
133+ typename Param::return_type>
134+
135+ get_kernel_info (const queue &q, sycl::range<2 > r, LaunchProperties props = {},
136+ size_t bytes = 0 ) {
137+ sycl::context ctxt = q.get_context ();
138+ sycl::device dev = q.get_device ();
139+ auto bundle =
140+ sycl::get_kernel_bundle<KernelName, sycl::bundle_state::executable>(ctxt);
141+ sycl::kernel k = bundle.template get_kernel <KernelName>();
142+ return k.ext_oneapi_get_info <Param>(dev, r, props, bytes);
143+ }
144+
145+ // Param must be info::kernel::max_num_work_groups_sync.
146+ template <typename KernelName, typename Param,
147+ typename LaunchProperties = empty_properties_t >
148+ typename std::enable_if_t <
149+ std::is_same_v<Param, sycl::info::kernel::max_num_work_groups_sync>,
150+ typename Param::return_type>
151+
152+ get_kernel_info (const queue &q, sycl::range<3 > r, LaunchProperties props = {},
153+ size_t bytes = 0 ) {
154+ sycl::context ctxt = q.get_context ();
155+ sycl::device dev = q.get_device ();
156+ auto bundle =
157+ sycl::get_kernel_bundle<KernelName, sycl::bundle_state::executable>(ctxt);
158+ sycl::kernel k = bundle.template get_kernel <KernelName>();
159+ return k.ext_oneapi_get_info <Param>(dev, r, props, bytes);
160+ }
161+
162+ // For free functions.
69163template <auto *Func, typename Param>
70164std::enable_if_t <ext::oneapi::experimental::is_kernel_v<Func>,
71165 typename sycl::detail::is_kernel_info_desc<Param>::return_type>
@@ -106,6 +200,104 @@ get_kernel_info(const context &, const device &) {
106200 return sycl::detail::FreeFunctionInfoData<Func>::getNumParams ();
107201}
108202
203+ // Param must be equal to max_num_work_groups_sync.
204+ template <auto *Func, typename Param,
205+ typename LaunchProperties = empty_properties_t >
206+ std::enable_if_t <
207+ sycl::ext::oneapi::experimental::is_kernel_v<Func> &&
208+ std::is_same_v<Param, sycl::info::kernel::max_num_work_groups_sync>,
209+ typename Param::return_type>
210+ get_kernel_info (const context &ctxt, const device &dev, sycl::range<1 > r,
211+ LaunchProperties props = {}, size_t bytes = 0 ) {
212+ auto bundle = sycl::ext::oneapi::experimental::get_kernel_bundle<
213+ Func, sycl::bundle_state::executable>(ctxt);
214+ sycl::kernel k = bundle.template ext_oneapi_get_kernel <Func>();
215+ return k.ext_oneapi_get_info <Param>(dev, r, props, bytes);
216+ }
217+
218+ // Param must be equal to max_num_work_groups_sync.
219+ template <auto *Func, typename Param,
220+ typename LaunchProperties = empty_properties_t >
221+ std::enable_if_t <
222+ sycl::ext::oneapi::experimental::is_kernel_v<Func> &&
223+ std::is_same_v<Param, sycl::info::kernel::max_num_work_groups_sync>,
224+ typename Param::return_type>
225+
226+ get_kernel_info (const context &ctxt, const device &dev, sycl::range<2 > r,
227+ LaunchProperties props = {}, size_t bytes = 0 ) {
228+ auto bundle = sycl::ext::oneapi::experimental::get_kernel_bundle<
229+ Func, sycl::bundle_state::executable>(ctxt);
230+ sycl::kernel k = bundle.template ext_oneapi_get_kernel <Func>();
231+ return k.ext_oneapi_get_info <Param>(dev, r, props, bytes);
232+ }
233+
234+ // Param must be equal to max_num_work_groups_sync.
235+ template <auto *Func, typename Param,
236+ typename LaunchProperties = empty_properties_t >
237+ std::enable_if_t <
238+ sycl::ext::oneapi::experimental::is_kernel_v<Func> &&
239+ std::is_same_v<Param, sycl::info::kernel::max_num_work_groups_sync>,
240+ typename Param::return_type>
241+
242+ get_kernel_info (const context &ctxt, const device &dev, sycl::range<3 > r,
243+ LaunchProperties props = {}, size_t bytes = 0 ) {
244+ auto bundle = sycl::ext::oneapi::experimental::get_kernel_bundle<
245+ Func, sycl::bundle_state::executable>(ctxt);
246+ sycl::kernel k = bundle.template ext_oneapi_get_kernel <Func>();
247+ return k.ext_oneapi_get_info <Param>(dev, r, props, bytes);
248+ }
249+
250+ // Param must be equal to max_num_work_groups_sync.
251+ template <auto *Func, typename Param,
252+ typename LaunchProperties = empty_properties_t >
253+ std::enable_if_t <
254+ sycl::ext::oneapi::experimental::is_kernel_v<Func> &&
255+ std::is_same_v<Param, sycl::info::kernel::max_num_work_groups_sync>,
256+ typename Param::return_type>
257+ get_kernel_info (const queue &q, sycl::range<1 > r, LaunchProperties props = {},
258+ size_t bytes = 0 ) {
259+ sycl::context ctxt = q.get_context ();
260+ sycl::device dev = q.get_device ();
261+ auto bundle = sycl::ext::oneapi::experimental::get_kernel_bundle<
262+ Func, sycl::bundle_state::executable>(ctxt);
263+ sycl::kernel k = bundle.template ext_oneapi_get_kernel <Func>();
264+ return k.ext_oneapi_get_info <Param>(dev, r, props, bytes);
265+ }
266+
267+ // Param must be equal to max_num_work_groups_sync.
268+ template <auto *Func, typename Param,
269+ typename LaunchProperties = empty_properties_t >
270+ std::enable_if_t <
271+ sycl::ext::oneapi::experimental::is_kernel_v<Func> &&
272+ std::is_same_v<Param, sycl::info::kernel::max_num_work_groups_sync>,
273+ typename Param::return_type>
274+ get_kernel_info (const queue &q, sycl::range<2 > r, LaunchProperties props = {},
275+ size_t bytes = 0 ) {
276+ sycl::context ctxt = q.get_context ();
277+ sycl::device dev = q.get_device ();
278+ auto bundle = sycl::ext::oneapi::experimental::get_kernel_bundle<
279+ Func, sycl::bundle_state::executable>(ctxt);
280+ sycl::kernel k = bundle.template ext_oneapi_get_kernel <Func>();
281+ return k.ext_oneapi_get_info <Param>(dev, r, props, bytes);
282+ }
283+
284+ // Param must be equal to max_num_work_groups_sync.
285+ template <auto *Func, typename Param,
286+ typename LaunchProperties = empty_properties_t >
287+ std::enable_if_t <
288+ sycl::ext::oneapi::experimental::is_kernel_v<Func> &&
289+ std::is_same_v<Param, sycl::info::kernel::max_num_work_groups_sync>,
290+ typename Param::return_type>
291+ get_kernel_info (const queue &q, sycl::range<3 > r, LaunchProperties props = {},
292+ size_t bytes = 0 ) {
293+ sycl::context ctxt = q.get_context ();
294+ sycl::device dev = q.get_device ();
295+ auto bundle = sycl::ext::oneapi::experimental::get_kernel_bundle<
296+ Func, sycl::bundle_state::executable>(ctxt);
297+ sycl::kernel k = bundle.template ext_oneapi_get_kernel <Func>();
298+ return k.ext_oneapi_get_info <Param>(dev, r, props, bytes);
299+ }
300+
109301} // namespace experimental
110302} // namespace ext::oneapi
111303} // namespace _V1
0 commit comments