@@ -35,8 +35,8 @@ from dpctl._backend cimport ( # noqa: E211, E402;
35
35
DPCTLKernel_GetCompileNumSubGroups,
36
36
DPCTLKernel_GetCompileSubGroupSize,
37
37
DPCTLKernel_GetMaxNumSubGroups,
38
- DPCTLKernel_GetNumArgs,
39
38
DPCTLKernel_GetName,
39
+ DPCTLKernel_GetNumArgs,
40
40
DPCTLKernel_GetPreferredWorkGroupSizeMultiple,
41
41
DPCTLKernel_GetPrivateMemSize,
42
42
DPCTLKernel_GetWorkGroupSize,
@@ -167,21 +167,25 @@ cdef class SyclKernel:
167
167
cdef size_t n = DPCTLKernel_GetCompileSubGroupSize(self ._kernel_ref)
168
168
return n
169
169
170
+
170
171
cdef api DPCTLSyclKernelRef SyclKernel_GetKernelRef(SyclKernel ker):
171
172
""" C-API function to access opaque kernel reference from
172
173
Python object of type :class:`dpctl.program.SyclKernel`.
173
174
"""
174
175
return ker.get_kernel_ref()
175
176
176
- cdef api SyclKernel SyclKernel_Make(DPCTLSyclKernelRef KRef):
177
+
178
+ cdef api SyclKernel SyclKernel_Make(DPCTLSyclKernelRef KRef, const char * name):
177
179
"""
178
180
C-API function to create :class:`dpctl.program.SyclKernel`
179
181
instance from opaque sycl kernel reference.
180
182
"""
181
183
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
+
185
189
186
190
cdef class SyclProgram:
187
191
""" 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,
309
313
310
314
return SyclProgram._create(KBref)
311
315
316
+
312
317
cdef api DPCTLSyclKernelBundleRef SyclProgram_GetKernelBundleRef(SyclProgram pro):
313
318
""" C-API function to access opaque kernel bundle reference from
314
319
Python object of type :class:`dpctl.program.SyclKernel`.
315
320
"""
316
321
return pro.get_program_ref()
317
322
323
+
318
324
cdef api SyclProgram SyclProgram_Make(DPCTLSyclKernelBundleRef KBRef):
319
325
"""
320
326
C-API function to create :class:`dpctl.program.SyclProgram`
0 commit comments