Skip to content

clean-up of __init__.py files per linters #421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 82 additions & 34 deletions dpctl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,91 @@
"""
__author__ = "Intel Corp."

from .enum_types import *
from .enum_types import __all__ as _enum_types_all__
from dpctl._sycl_context import *
from dpctl._sycl_context import __all__ as _sycl_context__all__
from dpctl._sycl_device import *
from dpctl._sycl_device import __all__ as _sycl_device__all__
from dpctl._sycl_device_factory import *
from dpctl._sycl_device_factory import __all__ as _sycl_device_factory__all__
from dpctl._sycl_event import *
from dpctl._sycl_event import __all__ as _sycl_event__all__
from dpctl._sycl_platform import *
from dpctl._sycl_platform import __all__ as _sycl_platform__all__
from dpctl._sycl_queue import *
from dpctl._sycl_queue import __all__ as _sycl_queue__all__
from dpctl._sycl_queue_manager import *
from dpctl._sycl_queue_manager import __all__ as _sycl_qm__all__
from dpctl._sycl_context import SyclContext
from dpctl._sycl_device import SyclDevice
from dpctl._sycl_device_factory import (
get_devices,
get_num_devices,
has_accelerator_devices,
has_cpu_devices,
has_gpu_devices,
has_host_device,
select_accelerator_device,
select_cpu_device,
select_default_device,
select_gpu_device,
select_host_device,
)
from dpctl._sycl_event import SyclEvent
from dpctl._sycl_platform import SyclPlatform, get_platforms, lsplatform
from dpctl._sycl_queue import (
SyclKernelInvalidRangeError,
SyclKernelSubmitError,
SyclQueue,
SyclQueueCreationError,
)
from dpctl._sycl_queue_manager import (
device_context,
get_current_backend,
get_current_device_type,
get_current_queue,
get_num_activated_queues,
is_in_device_context,
set_global_queue,
)
from ._version import get_versions
from .enum_types import backend_type, device_type

__all__ = [
"SyclContext",
]
__all__ += [
"SyclDevice",
]

__all__ = (
_sycl_context__all__
+ _sycl_device__all__
+ _sycl_device_factory__all__
+ _sycl_event__all__
+ _sycl_platform__all__
+ _sycl_queue__all__
+ _sycl_qm__all__
+ _enum_types_all__
)
__all__ += [
"get_devices",
"select_accelerator_device",
"select_cpu_device",
"select_default_device",
"select_gpu_device",
"select_host_device",
"get_num_devices",
"has_cpu_devices",
"has_gpu_devices",
"has_accelerator_devices",
"has_host_device",
]
__all__ += [
"SyclEvent",
]
__all__ += [
"get_platforms",
"lsplatform",
"SyclPlatform",
]
__all__ += [
"SyclQueue",
"SyclKernelInvalidRangeError",
"SyclKernelSubmitError",
"SyclQueueCreationError",
]
__all__ += [
"device_context",
"get_current_backend",
"get_current_device_type",
"get_current_queue",
"get_num_activated_queues",
"is_in_device_context",
"set_global_queue",
]
__all__ += [
"device_type",
"backend_type",
]
__all__ += [
"get_include",
]


def get_include():
Expand All @@ -69,11 +125,3 @@ def get_include():

__version__ = get_versions()["version"]
del get_versions
del _sycl_context__all__
del _sycl_device__all__
del _sycl_device_factory__all__
del _sycl_event__all__
del _sycl_queue__all__
del _sycl_qm__all__
del _sycl_platform__all__
del _enum_types_all__
5 changes: 2 additions & 3 deletions dpctl/memory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
`memoryview`, or `array.array` classes.

"""
from ._memory import MemoryUSMShared, MemoryUSMDevice, MemoryUSMHost
from ._memory import __all__ as _memory__all__
from ._memory import MemoryUSMDevice, MemoryUSMHost, MemoryUSMShared

__all__ = _memory__all__
__all__ = ["MemoryUSMDevice", "MemoryUSMHost", "MemoryUSMShared"]
17 changes: 14 additions & 3 deletions dpctl/program/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,18 @@
source string or SPIR-V binary file.

"""
from ._program import *
from ._program import __all__ as _program__all__
from ._program import (
SyclKernel,
SyclProgram,
SyclProgramCompilationError,
create_program_from_source,
create_program_from_spirv,
)

__all__ = _program__all__
__all__ = [
"create_program_from_source",
"create_program_from_spirv",
"SyclKernel",
"SyclProgram",
"SyclProgramCompilationError",
]
2 changes: 0 additions & 2 deletions dpctl/tensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@
underlying memory buffer is allocated with a USM shared memory allocator.

"""

import dpctl.tensor.numpy_usm_shared
12 changes: 0 additions & 12 deletions dpctl/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,3 @@

"""Top-level module of all dpctl Python unit test cases.
"""

from .test_dparray import *
from .test_sycl_device import *
from .test_sycl_context import *
from .test_sycl_kernel_submit import *
from .test_sycl_platform import *
from .test_sycl_program import *
from .test_sycl_queue import *
from .test_sycl_queue_manager import *
from .test_sycl_queue_memcpy import *
from .test_sycl_usm import *
from .test_dparray import *