@@ -35,8 +35,8 @@ from dpctl._backend cimport ( # noqa: E211, E402;
3535 DPCTLKernel_GetCompileNumSubGroups,
3636 DPCTLKernel_GetCompileSubGroupSize,
3737 DPCTLKernel_GetMaxNumSubGroups,
38- DPCTLKernel_GetNumArgs,
3938 DPCTLKernel_GetName,
39+ DPCTLKernel_GetNumArgs,
4040 DPCTLKernel_GetPreferredWorkGroupSizeMultiple,
4141 DPCTLKernel_GetPrivateMemSize,
4242 DPCTLKernel_GetWorkGroupSize,
@@ -167,21 +167,25 @@ cdef class SyclKernel:
167167 cdef size_t n = DPCTLKernel_GetCompileSubGroupSize(self ._kernel_ref)
168168 return n
169169
170+
170171cdef api DPCTLSyclKernelRef SyclKernel_GetKernelRef(SyclKernel ker):
171172 """ C-API function to access opaque kernel reference from
172173 Python object of type :class:`dpctl.program.SyclKernel`.
173174 """
174175 return ker.get_kernel_ref()
175176
176- cdef api SyclKernel SyclKernel_Make(DPCTLSyclKernelRef KRef):
177+
178+ cdef api SyclKernel SyclKernel_Make(DPCTLSyclKernelRef KRef, const char * name):
177179 """
178180 C-API function to create :class:`dpctl.program.SyclKernel`
179181 instance from opaque sycl kernel reference.
180182 """
181183 cdef DPCTLSyclKernelRef copied_KRef = DPCTLKernel_Copy(KRef)
182- cdef const char * name = DPCTLKernel_GetName(copied_KRef)
183- copied_name = name.decode(" UTF-8" )
184- return SyclKernel._create(copied_KRef, copied_name)
184+ if (name is NULL ):
185+ return SyclKernel._create(copied_KRef, " default_name" )
186+ else :
187+ return SyclKernel._create(copied_KRef, name.decode(" utf-8" ))
188+
185189
186190cdef class SyclProgram:
187191 """ Wraps a ``sycl::kernel_bundle<sycl::bundle_state::executable>`` object
@@ -309,12 +313,14 @@ cpdef create_program_from_spirv(SyclQueue q, const unsigned char[:] IL,
309313
310314 return SyclProgram._create(KBref)
311315
316+
312317cdef api DPCTLSyclKernelBundleRef SyclProgram_GetKernelBundleRef(SyclProgram pro):
313318 """ C-API function to access opaque kernel bundle reference from
314319 Python object of type :class:`dpctl.program.SyclKernel`.
315320 """
316321 return pro.get_program_ref()
317322
323+
318324cdef api SyclProgram SyclProgram_Make(DPCTLSyclKernelBundleRef KBRef):
319325 """
320326 C-API function to create :class:`dpctl.program.SyclProgram`
0 commit comments