@@ -100,7 +100,8 @@ struct dpctl_capi
100
100
DPCTLSyclKernelRef (* SyclKernel_GetKernelRef_ )(PySyclKernelObject * );
101
101
PySyclKernelObject * (* SyclKernel_Make_ )(DPCTLSyclKernelRef );
102
102
103
- DPCTLSyclKernelBundleRef (* SyclProgram_GetKernelBundleRef_ )(PySyclProgramObject * );
103
+ DPCTLSyclKernelBundleRef (* SyclProgram_GetKernelBundleRef_ )(
104
+ PySyclProgramObject * );
104
105
PySyclProgramObject * (* SyclProgram_Make_ )(DPCTLSyclKernelBundleRef );
105
106
106
107
// tensor
@@ -551,8 +552,8 @@ template <> struct type_caster<sycl::kernel>
551
552
return true;
552
553
}
553
554
else {
554
- throw py ::type_error (
555
- "Input is of unexpected type, expected dpctl.program.SyclKernel" );
555
+ throw py ::type_error ("Input is of unexpected type, expected "
556
+ " dpctl.program.SyclKernel" );
556
557
}
557
558
}
558
559
@@ -567,22 +568,28 @@ template <> struct type_caster<sycl::kernel>
567
568
DPCTL_TYPE_CASTER (sycl ::kernel , _ ("dpctl.program.SyclKernel" ));
568
569
};
569
570
570
- /* This type caster associates ``sycl::kernel_bundle<sycl::bundle_state::executable>`` C++ class with
571
+ /* This type caster associates
572
+ * ``sycl::kernel_bundle<sycl::bundle_state::executable>`` C++ class with
571
573
* :class:`dpctl.program.SyclProgram` for the purposes of generation of
572
574
* Python bindings by pybind11.
573
575
*/
574
- template < > struct type_caster < sycl ::kernel_bundle < sycl ::bundle_state ::executable >>
576
+ template < >
577
+ struct type_caster < sycl ::kernel_bundle < sycl ::bundle_state ::executable >>
575
578
{
576
579
public :
577
580
bool load (handle src , bool )
578
581
{
579
582
PyObject * source = src .ptr ();
580
583
auto & api = ::dpctl ::detail ::dpctl_capi ::get ();
581
584
if (api .PySyclProgram_Check_ (source )) {
582
- DPCTLSyclKernelBundleRef KBRef = api .SyclProgram_GetKernelBundleRef_ (
583
- reinterpret_cast < PySyclProgramObject * > (source ));
584
- value = std ::make_unique < sycl ::kernel_bundle < sycl ::bundle_state ::executable >>(
585
- * (reinterpret_cast < sycl ::kernel_bundle < sycl ::bundle_state ::executable > * > (KBRef )));
585
+ DPCTLSyclKernelBundleRef KBRef =
586
+ api .SyclProgram_GetKernelBundleRef_ (
587
+ reinterpret_cast < PySyclProgramObject * > (source ));
588
+ value = std ::make_unique <
589
+ sycl ::kernel_bundle < sycl ::bundle_state ::executable >>(
590
+ * (reinterpret_cast <
591
+ sycl ::kernel_bundle < sycl ::bundle_state ::executable > * > (
592
+ KBRef )));
586
593
return true;
587
594
}
588
595
else {
@@ -591,15 +598,18 @@ template <> struct type_caster<sycl::kernel_bundle<sycl::bundle_state::executabl
591
598
}
592
599
}
593
600
594
- static handle cast (sycl ::kernel_bundle < sycl ::bundle_state ::executable > src , return_value_policy , handle )
601
+ static handle cast (sycl ::kernel_bundle < sycl ::bundle_state ::executable > src ,
602
+ return_value_policy ,
603
+ handle )
595
604
{
596
605
auto & api = ::dpctl ::detail ::dpctl_capi ::get ();
597
- auto tmp =
598
- api . SyclProgram_Make_ ( reinterpret_cast < DPCTLSyclKernelBundleRef > (& src ));
606
+ auto tmp = api . SyclProgram_Make_ (
607
+ reinterpret_cast < DPCTLSyclKernelBundleRef > (& src ));
599
608
return handle (reinterpret_cast < PyObject * > (tmp ));
600
609
}
601
610
602
- DPCTL_TYPE_CASTER (sycl ::kernel_bundle < sycl ::bundle_state ::executable > , _ ("dpctl.program.SyclProgram" ));
611
+ DPCTL_TYPE_CASTER (sycl ::kernel_bundle < sycl ::bundle_state ::executable > ,
612
+ _ ("dpctl.program.SyclProgram" ));
603
613
};
604
614
} // namespace detail
605
615
} // namespace pybind11
0 commit comments