Skip to content

Commit 86c3863

Browse files
committed
Formatting and double-quote strings
1 parent 6c12649 commit 86c3863

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

dpctl/_backend.pxd

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -453,18 +453,18 @@ cdef extern from "syclinterface/dpctl_sycl_kernel_bundle_interface.h":
453453
cdef DPCTLBuildOptionListRef DPCTLBuildOptionList_Create()
454454
cdef void DPCTLBuildOptionList_Delete(DPCTLBuildOptionListRef Ref)
455455
cdef void DPCTLBuildOptionList_Append(DPCTLBuildOptionListRef Ref,
456-
const char *Option)
456+
const char *Option)
457457

458458
cdef DPCTLKernelNameListRef DPCTLKernelNameList_Create()
459459
cdef void DPCTLKernelNameList_Delete(DPCTLKernelNameListRef Ref)
460460
cdef void DPCTLKernelNameList_Append(DPCTLKernelNameListRef Ref,
461-
const char *Option)
461+
const char *Option)
462462

463463
cdef DPCTLVirtualHeaderListRef DPCTLVirtualHeaderList_Create()
464464
cdef void DPCTLVirtualHeaderList_Delete(DPCTLVirtualHeaderListRef Ref)
465465
cdef void DPCTLVirtualHeaderList_Append(DPCTLVirtualHeaderListRef Ref,
466-
const char *Name,
467-
const char *Content)
466+
const char *Name,
467+
const char *Content)
468468

469469
cdef DPCTLSyclKernelBundleRef DPCTLKernelBundle_CreateFromSYCLSource(
470470
const DPCTLSyclContextRef Ctx,
@@ -474,11 +474,12 @@ cdef extern from "syclinterface/dpctl_sycl_kernel_bundle_interface.h":
474474
DPCTLKernelNameListRef Names,
475475
DPCTLBuildOptionListRef BuildOptions)
476476

477-
cdef DPCTLSyclKernelRef DPCTLKernelBundle_GetSyclKernel(DPCTLSyclKernelBundleRef KBRef,
478-
const char *KernelName)
477+
cdef DPCTLSyclKernelRef DPCTLKernelBundle_GetSyclKernel(
478+
DPCTLSyclKernelBundleRef KBRef,
479+
const char *KernelName)
479480

480481
cdef bool DPCTLKernelBundle_HasSyclKernel(DPCTLSyclKernelBundleRef KBRef,
481-
const char *KernelName);
482+
const char *KernelName)
482483

483484

484485
cdef extern from "syclinterface/dpctl_sycl_queue_interface.h":

dpctl/_sycl_device.pyx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ from ._backend cimport ( # noqa: E211
2626
DPCTLDefaultSelector_Create,
2727
DPCTLDevice_AreEq,
2828
DPCTLDevice_CanCompileOpenCL,
29-
DPCTLDevice_CanCompileSPIRV,
3029
DPCTLDevice_CanCompileSYCL,
3130
DPCTLDevice_Copy,
3231
DPCTLDevice_CreateFromSelector,
@@ -2192,7 +2191,6 @@ cdef class SyclDevice(_SyclDevice):
21922191
raise ValueError(f"Unknown source language {language}")
21932192

21942193

2195-
21962194
cdef api DPCTLSyclDeviceRef SyclDevice_GetDeviceRef(SyclDevice dev):
21972195
"""
21982196
C-API function to get opaque device reference from

dpctl/program/_program.pxd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ cdef api class SyclProgram [object PySyclProgramObject, type PySyclProgramType]:
5252
cdef bint _is_sycl_source
5353

5454
@staticmethod
55-
cdef SyclProgram _create (DPCTLSyclKernelBundleRef pref, bint _is_sycl_source)
55+
cdef SyclProgram _create (DPCTLSyclKernelBundleRef pref,
56+
bint _is_sycl_source)
5657
cdef DPCTLSyclKernelBundleRef get_program_ref (self)
5758
cpdef SyclKernel get_sycl_kernel(self, str kernel_name)
5859

dpctl/program/_program.pyx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ cdef class SyclProgram:
211211
"""
212212

213213
@staticmethod
214-
cdef SyclProgram _create(DPCTLSyclKernelBundleRef KBRef, bint is_sycl_source):
214+
cdef SyclProgram _create(DPCTLSyclKernelBundleRef KBRef,
215+
bint is_sycl_source):
215216
cdef SyclProgram ret = SyclProgram.__new__(SyclProgram)
216217
ret._program_ref = KBRef
217218
ret._is_sycl_source = is_sycl_source
@@ -342,7 +343,10 @@ cpdef create_program_from_spirv(SyclQueue q, const unsigned char[:] IL,
342343
return SyclProgram._create(KBref, False)
343344

344345

345-
cpdef create_program_from_sycl_source(SyclQueue q, unicode source, list headers=[], list registered_names=[], list copts=[]):
346+
cpdef create_program_from_sycl_source(SyclQueue q, unicode source,
347+
list headers=None,
348+
list registered_names=None,
349+
list copts=None):
346350
"""
347351
Creates an executable SYCL kernel_bundle from SYCL source code.
348352
@@ -384,7 +388,7 @@ cpdef create_program_from_sycl_source(SyclQueue q, unicode source, list headers=
384388
cdef DPCTLSyclKernelBundleRef KBref
385389
cdef DPCTLSyclContextRef CRef = q.get_sycl_context().get_context_ref()
386390
cdef DPCTLSyclDeviceRef DRef = q.get_sycl_device().get_device_ref()
387-
cdef bytes bSrc = source.encode('utf8')
391+
cdef bytes bSrc = source.encode("utf8")
388392
cdef const char *Src = <const char*>bSrc
389393
cdef DPCTLBuildOptionListRef BuildOpts = DPCTLBuildOptionList_Create()
390394
cdef bytes bOpt
@@ -397,7 +401,7 @@ cpdef create_program_from_sycl_source(SyclQueue q, unicode source, list headers=
397401
if not isinstance(opt, unicode):
398402
DPCTLBuildOptionList_Delete(BuildOpts)
399403
raise SyclProgramCompilationError()
400-
bOpt = opt.encode('utf8')
404+
bOpt = opt.encode("utf8")
401405
sOpt = <const char*>bOpt
402406
DPCTLBuildOptionList_Append(BuildOpts, sOpt)
403407

@@ -407,21 +411,22 @@ cpdef create_program_from_sycl_source(SyclQueue q, unicode source, list headers=
407411
DPCTLBuildOptionList_Delete(BuildOpts)
408412
DPCTLKernelNameList_Delete(KernelNames)
409413
raise SyclProgramCompilationError()
410-
bName = name.encode('utf8')
414+
bName = name.encode("utf8")
411415
sName = <const char*>bName
412416
DPCTLKernelNameList_Append(KernelNames, sName)
413417

418+
cdef DPCTLVirtualHeaderListRef VirtualHeaders
419+
VirtualHeaders = DPCTLVirtualHeaderList_Create()
414420

415-
cdef DPCTLVirtualHeaderListRef VirtualHeaders = DPCTLVirtualHeaderList_Create()
416421
for name, content in headers:
417422
if not isinstance(name, unicode) or not isinstance(content, unicode):
418423
DPCTLBuildOptionList_Delete(BuildOpts)
419424
DPCTLKernelNameList_Delete(KernelNames)
420425
DPCTLVirtualHeaderList_Delete(VirtualHeaders)
421426
raise SyclProgramCompilationError()
422-
bName = name.encode('utf8')
427+
bName = name.encode("utf8")
423428
sName = <const char*>bName
424-
bContent = content.encode('utf8')
429+
bContent = content.encode("utf8")
425430
sContent = <const char*>bContent
426431
DPCTLVirtualHeaderList_Append(VirtualHeaders, sName, sContent)
427432

0 commit comments

Comments
 (0)