Skip to content

Commit 05a9671

Browse files
author
Diptorup Deb
committed
Various fixes done by isort and new black config.
1 parent 6f704ed commit 05a9671

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+359
-198
lines changed

docs/conf.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ use_doxyrest = "@DPCTL_ENABLE_DOXYREST@"
4141

4242
if use_doxyrest == "ON":
4343
# Specify the path to Doxyrest extensions for Sphinx:
44-
import sys, os
44+
import os
45+
import sys
4546

4647
sys.path.insert(
4748
1,
@@ -168,9 +169,8 @@ class ClassMembersDocumenter(ClassDocumenter):
168169
# members and attributes.
169170
# See https://stackoverflow.com/questions/20569011/python-sphinx-autosummary-automated-listing-of-member-functions
170171

171-
from sphinx.ext.autosummary import Autosummary
172-
from sphinx.ext.autosummary import get_documenter
173172
from docutils.parsers.rst import directives
173+
from sphinx.ext.autosummary import Autosummary, get_documenter
174174
from sphinx.util.inspect import safe_getattr
175175

176176

dpctl/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
"""
2525
__author__ = "Intel Corp."
2626

27-
from .enum_types import *
28-
from .enum_types import __all__ as _enum_types_all__
2927
from dpctl._sycl_context import *
3028
from dpctl._sycl_context import __all__ as _sycl_context__all__
3129
from dpctl._sycl_device import *
@@ -40,8 +38,10 @@
4038
from dpctl._sycl_queue import __all__ as _sycl_queue__all__
4139
from dpctl._sycl_queue_manager import *
4240
from dpctl._sycl_queue_manager import __all__ as _sycl_qm__all__
43-
from ._version import get_versions
4441

42+
from ._version import get_versions
43+
from .enum_types import *
44+
from .enum_types import __all__ as _enum_types_all__
4545

4646
__all__ = (
4747
_sycl_context__all__

dpctl/_backend.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
types defined by dpctl's C API.
2222
"""
2323

24+
from libc.stdint cimport int64_t, uint32_t
2425
from libcpp cimport bool
25-
from libc.stdint cimport uint32_t, int64_t
2626

2727

2828
cdef extern from "dpctl_error_handler_type.h":

dpctl/_sycl_context.pxd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
""" This file declares the SyclContext extension type.
2121
"""
2222

23+
from libcpp cimport bool
24+
2325
from ._backend cimport DPCTLSyclContextRef
2426
from ._sycl_device cimport SyclDevice
25-
from libcpp cimport bool
27+
2628

2729
cdef class _SyclContext:
2830
""" Data owner for SyclContext

dpctl/_sycl_context.pyx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,34 @@
2121
"""
2222

2323
from __future__ import print_function
24+
2425
import logging
25-
from ._backend cimport(
26-
DPCTLSyclContextRef,
27-
DPCTLSyclDeviceRef,
26+
27+
from cpython cimport pycapsule
28+
from cpython.mem cimport PyMem_Free, PyMem_Malloc
29+
30+
from ._backend cimport (
31+
DPCTLContext_AreEq,
32+
DPCTLContext_Copy,
2833
DPCTLContext_Create,
2934
DPCTLContext_CreateFromDevices,
35+
DPCTLContext_Delete,
3036
DPCTLContext_DeviceCount,
3137
DPCTLContext_GetDevices,
32-
DPCTLContext_Copy,
33-
DPCTLContext_Delete,
34-
DPCTLContext_AreEq,
35-
DPCTLDevice_Delete,
3638
DPCTLDevice_Copy,
37-
DPCTLDeviceVectorRef,
39+
DPCTLDevice_Delete,
40+
DPCTLDeviceMgr_GetCachedContext,
3841
DPCTLDeviceVector_CreateFromArray,
42+
DPCTLDeviceVector_Delete,
3943
DPCTLDeviceVector_GetAt,
4044
DPCTLDeviceVector_Size,
41-
DPCTLDeviceVector_Delete,
45+
DPCTLDeviceVectorRef,
46+
DPCTLSyclContextRef,
47+
DPCTLSyclDeviceRef,
4248
error_handler_callback,
43-
DPCTLDeviceMgr_GetCachedContext,
4449
)
45-
from ._sycl_queue cimport default_async_error_handler
4650
from ._sycl_device cimport SyclDevice
47-
from cpython.mem cimport PyMem_Malloc, PyMem_Free
48-
from cpython cimport pycapsule
51+
from ._sycl_queue cimport default_async_error_handler
4952

5053
__all__ = [
5154
"SyclContext",

dpctl/_sycl_device.pxd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@
2020
""" This file declares the SyclDevice extension type.
2121
"""
2222

23+
from libcpp cimport bool as cpp_bool
24+
2325
from ._backend cimport (
2426
DPCTLSyclDeviceRef,
2527
DPCTLSyclDeviceSelectorRef,
26-
_partition_affinity_domain_type
28+
_partition_affinity_domain_type,
2729
)
28-
from libcpp cimport bool as cpp_bool
2930

3031

3132
cdef class _SyclDevice:

dpctl/_sycl_device.pyx

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,70 +21,73 @@
2121
"""
2222

2323
from ._backend cimport (
24-
_aspect_type,
25-
_backend_type,
26-
_device_type,
27-
_partition_affinity_domain_type,
2824
DPCTLCString_Delete,
2925
DPCTLDefaultSelector_Create,
26+
DPCTLDevice_AreEq,
3027
DPCTLDevice_Copy,
3128
DPCTLDevice_CreateFromSelector,
29+
DPCTLDevice_CreateSubDevicesByAffinity,
30+
DPCTLDevice_CreateSubDevicesByCounts,
31+
DPCTLDevice_CreateSubDevicesEqually,
3232
DPCTLDevice_Delete,
33-
DPCTLDeviceVectorRef,
34-
DPCTLDeviceVector_Delete,
35-
DPCTLDeviceVector_GetAt,
36-
DPCTLDeviceVector_Size,
3733
DPCTLDevice_GetBackend,
38-
DPCTLDevice_AreEq,
3934
DPCTLDevice_GetDeviceType,
4035
DPCTLDevice_GetDriverVersion,
36+
DPCTLDevice_GetImage2dMaxHeight,
37+
DPCTLDevice_GetImage2dMaxWidth,
38+
DPCTLDevice_GetImage3dMaxDepth,
39+
DPCTLDevice_GetImage3dMaxHeight,
40+
DPCTLDevice_GetImage3dMaxWidth,
4141
DPCTLDevice_GetMaxComputeUnits,
4242
DPCTLDevice_GetMaxNumSubGroups,
43+
DPCTLDevice_GetMaxReadImageArgs,
4344
DPCTLDevice_GetMaxWorkGroupSize,
4445
DPCTLDevice_GetMaxWorkItemDims,
4546
DPCTLDevice_GetMaxWorkItemSizes,
46-
DPCTLDevice_GetVendor,
47+
DPCTLDevice_GetMaxWriteImageArgs,
4748
DPCTLDevice_GetName,
49+
DPCTLDevice_GetParentDevice,
50+
DPCTLDevice_GetPreferredVectorWidthChar,
51+
DPCTLDevice_GetPreferredVectorWidthDouble,
52+
DPCTLDevice_GetPreferredVectorWidthFloat,
53+
DPCTLDevice_GetPreferredVectorWidthHalf,
54+
DPCTLDevice_GetPreferredVectorWidthInt,
55+
DPCTLDevice_GetPreferredVectorWidthLong,
56+
DPCTLDevice_GetPreferredVectorWidthShort,
57+
DPCTLDevice_GetSubGroupIndependentForwardProgress,
58+
DPCTLDevice_GetVendor,
59+
DPCTLDevice_HasAspect,
4860
DPCTLDevice_IsAccelerator,
4961
DPCTLDevice_IsCPU,
5062
DPCTLDevice_IsGPU,
5163
DPCTLDevice_IsHost,
52-
DPCTLDeviceMgr_PrintDeviceInfo,
5364
DPCTLDeviceMgr_GetRelativeId,
54-
DPCTLFilterSelector_Create,
65+
DPCTLDeviceMgr_PrintDeviceInfo,
5566
DPCTLDeviceSelector_Delete,
5667
DPCTLDeviceSelector_Score,
68+
DPCTLDeviceVector_Delete,
69+
DPCTLDeviceVector_GetAt,
70+
DPCTLDeviceVector_Size,
71+
DPCTLDeviceVectorRef,
72+
DPCTLFilterSelector_Create,
5773
DPCTLSize_t_Array_Delete,
5874
DPCTLSyclBackendType,
5975
DPCTLSyclDeviceRef,
6076
DPCTLSyclDeviceSelectorRef,
61-
DPCTLDevice_HasAspect,
6277
DPCTLSyclDeviceType,
63-
DPCTLDevice_GetMaxReadImageArgs,
64-
DPCTLDevice_GetMaxWriteImageArgs,
65-
DPCTLDevice_GetImage2dMaxWidth,
66-
DPCTLDevice_GetImage2dMaxHeight,
67-
DPCTLDevice_GetImage3dMaxWidth,
68-
DPCTLDevice_GetImage3dMaxHeight,
69-
DPCTLDevice_GetImage3dMaxDepth,
70-
DPCTLDevice_GetSubGroupIndependentForwardProgress,
71-
DPCTLDevice_GetPreferredVectorWidthChar,
72-
DPCTLDevice_GetPreferredVectorWidthShort,
73-
DPCTLDevice_GetPreferredVectorWidthInt,
74-
DPCTLDevice_GetPreferredVectorWidthLong,
75-
DPCTLDevice_GetPreferredVectorWidthFloat,
76-
DPCTLDevice_GetPreferredVectorWidthDouble,
77-
DPCTLDevice_GetPreferredVectorWidthHalf,
78-
DPCTLDevice_CreateSubDevicesEqually,
79-
DPCTLDevice_CreateSubDevicesByCounts,
80-
DPCTLDevice_CreateSubDevicesByAffinity,
81-
DPCTLDevice_GetParentDevice,
78+
_aspect_type,
79+
_backend_type,
80+
_device_type,
81+
_partition_affinity_domain_type,
8282
)
83+
8384
from . import backend_type, device_type
84-
from libc.stdint cimport uint32_t, int64_t
85-
from libc.stdlib cimport malloc, free
86-
import warnings
85+
86+
from libc.stdint cimport int64_t, uint32_t
87+
from libc.stdlib cimport free, malloc
88+
8789
import collections
90+
import warnings
8891

8992
__all__ = [
9093
"SyclDevice",

dpctl/_sycl_device_factory.pxd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ specific backend or device_type.
2323
"""
2424

2525
from libcpp cimport bool as cpp_bool
26+
2627
from ._sycl_device cimport SyclDevice
2728

29+
2830
cpdef SyclDevice select_accelerator_device()
2931
cpdef SyclDevice select_cpu_device()
3032
cpdef SyclDevice select_default_device()

dpctl/_sycl_device_factory.pyx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,29 @@
2626
"""
2727

2828
from ._backend cimport (
29-
_backend_type,
30-
_device_type,
3129
DPCTLAcceleratorSelector_Create,
3230
DPCTLCPUSelector_Create,
3331
DPCTLDefaultSelector_Create,
3432
DPCTLDevice_CreateFromSelector,
3533
DPCTLDeviceMgr_GetDevices,
3634
DPCTLDeviceMgr_GetNumDevices,
3735
DPCTLDeviceSelector_Delete,
38-
DPCTLDeviceVectorRef,
3936
DPCTLDeviceVector_Delete,
4037
DPCTLDeviceVector_GetAt,
4138
DPCTLDeviceVector_Size,
39+
DPCTLDeviceVectorRef,
4240
DPCTLGPUSelector_Create,
4341
DPCTLHostSelector_Create,
4442
DPCTLSyclBackendType,
4543
DPCTLSyclDeviceRef,
4644
DPCTLSyclDeviceSelectorRef,
4745
DPCTLSyclDeviceType,
46+
_backend_type,
47+
_device_type,
4848
)
49-
from . import backend_type, device_type as device_type_t
49+
50+
from . import backend_type
51+
from . import device_type as device_type_t
5052

5153
__all__ = [
5254
"get_devices",

dpctl/_sycl_event.pyx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
"""
2222

2323
from __future__ import print_function
24+
2425
import logging
25-
from ._backend cimport DPCTLSyclEventRef, DPCTLEvent_Delete, DPCTLEvent_Wait
26+
27+
from ._backend cimport DPCTLEvent_Delete, DPCTLEvent_Wait, DPCTLSyclEventRef
2628

2729
__all__ = [
2830
"SyclEvent",

dpctl/_sycl_platform.pxd

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
SYCL platform-related helper functions.
2222
"""
2323

24-
from ._backend cimport (
25-
DPCTLSyclPlatformRef,
26-
DPCTLSyclDeviceSelectorRef,
27-
)
24+
from ._backend cimport DPCTLSyclDeviceSelectorRef, DPCTLSyclPlatformRef
2825

2926

3027
cdef class _SyclPlatform:

dpctl/_sycl_platform.pyx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
"""
2222

2323
from __future__ import print_function
24-
from ._backend cimport(
25-
_backend_type,
24+
25+
from ._backend cimport (
2626
DPCTLCString_Delete,
27-
DPCTLFilterSelector_Create,
2827
DPCTLDeviceSelector_Delete,
28+
DPCTLFilterSelector_Create,
2929
DPCTLPlatform_Copy,
3030
DPCTLPlatform_Create,
3131
DPCTLPlatform_CreateFromSelector,
@@ -43,7 +43,9 @@ from ._backend cimport(
4343
DPCTLSyclBackendType,
4444
DPCTLSyclDeviceSelectorRef,
4545
DPCTLSyclPlatformRef,
46+
_backend_type,
4647
)
48+
4749
from . import backend_type
4850

4951
__all__ = [

dpctl/_sycl_queue.pxd

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@
2020
""" This file declares the SyclQueue extension type.
2121
"""
2222

23-
from ._backend cimport (
24-
DPCTLSyclDeviceRef,
25-
DPCTLKernelArgType,
26-
DPCTLSyclQueueRef,
27-
)
23+
from libcpp cimport bool as cpp_bool
24+
25+
from ._backend cimport DPCTLKernelArgType, DPCTLSyclDeviceRef, DPCTLSyclQueueRef
2826
from ._sycl_context cimport SyclContext
29-
from ._sycl_event cimport SyclEvent
3027
from ._sycl_device cimport SyclDevice
28+
from ._sycl_event cimport SyclEvent
3129
from .program._program cimport SyclKernel
32-
from libcpp cimport bool as cpp_bool
30+
3331

3432
cdef void default_async_error_handler(int) nogil except *
3533

0 commit comments

Comments
 (0)