@@ -1038,6 +1038,23 @@ class __SYCL_EXPORT handler {
1038
1038
void setHandlerKernelBundle (
1039
1039
const std::shared_ptr<detail::kernel_bundle_impl> &NewKernelBundleImpPtr);
1040
1040
1041
+ template <typename FuncT>
1042
+ detail::enable_if_t <
1043
+ detail::check_fn_signature<detail::remove_reference_t <FuncT>,
1044
+ void ()>::value ||
1045
+ detail::check_fn_signature<detail::remove_reference_t <FuncT>,
1046
+ void (interop_handle)>::value>
1047
+ host_task_impl (FuncT &&Func) {
1048
+ throwIfActionIsCreated ();
1049
+
1050
+ MNDRDesc.set (range<1 >(1 ));
1051
+ MArgs = std::move (MAssociatedAccesors);
1052
+
1053
+ MHostTask.reset (new detail::HostTask (std::move (Func)));
1054
+
1055
+ setType (detail::CG::CODEPLAY_HOST_TASK);
1056
+ }
1057
+
1041
1058
public:
1042
1059
handler (const handler &) = delete ;
1043
1060
handler (handler &&) = delete ;
@@ -1231,31 +1248,26 @@ class __SYCL_EXPORT handler {
1231
1248
}
1232
1249
1233
1250
template <typename FuncT>
1234
- detail::enable_if_t <detail::check_fn_signature<
1235
- detail::remove_reference_t <FuncT>, void ()>::value>
1236
- codeplay_host_task (FuncT Func) {
1237
- throwIfActionIsCreated ();
1238
-
1239
- MNDRDesc.set (range<1 >(1 ));
1240
- MArgs = std::move (MAssociatedAccesors);
1241
-
1242
- MHostTask.reset (new detail::HostTask (std::move (Func)));
1243
-
1244
- setType (detail::CG::CODEPLAY_HOST_TASK);
1245
- }
1246
-
1251
+ __SYCL2020_DEPRECATED (
1252
+ " codeplay_host_task() is deprecated, use host_task() instead" )
1253
+ detail::enable_if_t <
1254
+ detail::check_fn_signature<detail::remove_reference_t <FuncT>,
1255
+ void ()>::value ||
1256
+ detail::check_fn_signature<
1257
+ detail::remove_reference_t <FuncT>,
1258
+ void (interop_handle)>::value> codeplay_host_task (FuncT Func) {
1259
+ host_task_impl (Func);
1260
+ }
1261
+
1262
+ // / Enqueues a command to the SYCL runtime to invoke \p Func once.
1247
1263
template <typename FuncT>
1248
- detail::enable_if_t <detail::check_fn_signature<
1249
- detail::remove_reference_t <FuncT>, void (interop_handle)>::value>
1250
- codeplay_host_task (FuncT Func) {
1251
- throwIfActionIsCreated ();
1252
-
1253
- MNDRDesc.set (range<1 >(1 ));
1254
- MArgs = std::move (MAssociatedAccesors);
1255
-
1256
- MHostTask.reset (new detail::HostTask (std::move (Func)));
1257
-
1258
- setType (detail::CG::CODEPLAY_HOST_TASK);
1264
+ detail::enable_if_t <
1265
+ detail::check_fn_signature<detail::remove_reference_t <FuncT>,
1266
+ void ()>::value ||
1267
+ detail::check_fn_signature<detail::remove_reference_t <FuncT>,
1268
+ void (interop_handle)>::value>
1269
+ host_task (FuncT &&Func) {
1270
+ host_task_impl (Func);
1259
1271
}
1260
1272
1261
1273
// replace _KERNELFUNCPARAM(KernelFunc) with KernelType KernelFunc
0 commit comments