From a3174fc74a36184318e05e02973a89877deb9f15 Mon Sep 17 00:00:00 2001 From: Diptorup Deb Date: Thu, 2 Nov 2023 18:33:32 -0500 Subject: [PATCH] Reorganize new features that belong to experimental module. --- numba_dpex/core/types/__init__.py | 2 -- numba_dpex/core/typing/typeof.py | 2 +- numba_dpex/experimental/__init__.py | 13 ++++++++++++- .../dpcpp_iface/__init__.py | 5 ++++- .../dpcpp_iface/_spv_atomic_helper.py | 0 .../dpcpp_iface/atomic_ref.py | 0 .../dpcpp_iface/memory_enums.py | 0 .../{core/types => experimental}/dpcpp_types.py | 0 8 files changed, 17 insertions(+), 5 deletions(-) rename numba_dpex/{core/kernel_interface => experimental}/dpcpp_iface/__init__.py (61%) rename numba_dpex/{core/kernel_interface => experimental}/dpcpp_iface/_spv_atomic_helper.py (100%) rename numba_dpex/{core/kernel_interface => experimental}/dpcpp_iface/atomic_ref.py (100%) rename numba_dpex/{core/kernel_interface => experimental}/dpcpp_iface/memory_enums.py (100%) rename numba_dpex/{core/types => experimental}/dpcpp_types.py (100%) diff --git a/numba_dpex/core/types/__init__.py b/numba_dpex/core/types/__init__.py index 6e05bfe8c8..6cb831974e 100644 --- a/numba_dpex/core/types/__init__.py +++ b/numba_dpex/core/types/__init__.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: Apache-2.0 from .array_type import Array -from .dpcpp_types import AtomicRefType from .dpctl_types import DpctlSyclEvent, DpctlSyclQueue from .dpnp_ndarray_type import DpnpNdArray from .literal_intenum_type import IntEnumLiteral @@ -35,7 +34,6 @@ __all__ = [ "Array", - "AtomicRefType", "DpctlSyclQueue", "DpctlSyclEvent", "DpnpNdArray", diff --git a/numba_dpex/core/typing/typeof.py b/numba_dpex/core/typing/typeof.py index 8cc8252908..f3901eaf7a 100644 --- a/numba_dpex/core/typing/typeof.py +++ b/numba_dpex/core/typing/typeof.py @@ -11,8 +11,8 @@ from numba_dpex.core.kernel_interface.dpcpp_iface import AtomicRef from numba_dpex.utils import address_space +from ...experimental.dpcpp_types import AtomicRefType from ..kernel_interface.indexers import NdRange, Range -from ..types.dpcpp_types import AtomicRefType from ..types.dpctl_types import DpctlSyclEvent, DpctlSyclQueue from ..types.dpnp_ndarray_type import DpnpNdArray from ..types.range_types import NdRangeType, RangeType diff --git a/numba_dpex/experimental/__init__.py b/numba_dpex/experimental/__init__.py index 589d10df5d..b4f274ae7b 100644 --- a/numba_dpex/experimental/__init__.py +++ b/numba_dpex/experimental/__init__.py @@ -9,6 +9,8 @@ from numba.core.imputils import Registry from .decorators import kernel +from .dpcpp_iface import AddressSpace, AtomicRef, MemoryOrder, MemoryScope +from .dpcpp_types import AtomicRefType from .kernel_dispatcher import KernelDispatcher from .launcher import call_kernel from .models import * @@ -26,4 +28,13 @@ def dpex_dispatcher_const(context): return context.get_dummy_value() -__all__ = ["kernel", "KernelDispatcher", "call_kernel"] +__all__ = [ + "kernel", + "call_kernel", + "AddressSpace", + "AtomicRef", + "AtomicRefType", + "KernelDispatcher", + "MemoryOrder", + "MemoryScope", +] diff --git a/numba_dpex/core/kernel_interface/dpcpp_iface/__init__.py b/numba_dpex/experimental/dpcpp_iface/__init__.py similarity index 61% rename from numba_dpex/core/kernel_interface/dpcpp_iface/__init__.py rename to numba_dpex/experimental/dpcpp_iface/__init__.py index 322d8343ae..859ba9ef3e 100644 --- a/numba_dpex/core/kernel_interface/dpcpp_iface/__init__.py +++ b/numba_dpex/experimental/dpcpp_iface/__init__.py @@ -1,7 +1,10 @@ -# SPDX-FileCopyrightText: 2020 - 2023 Intel Corporation +# SPDX-FileCopyrightText: 2023 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 +"""Python classes that are analogous to dpcpp's SYCL API used to write kernels. +""" + from .atomic_ref import AtomicRef from .memory_enums import AddressSpace, MemoryOrder, MemoryScope diff --git a/numba_dpex/core/kernel_interface/dpcpp_iface/_spv_atomic_helper.py b/numba_dpex/experimental/dpcpp_iface/_spv_atomic_helper.py similarity index 100% rename from numba_dpex/core/kernel_interface/dpcpp_iface/_spv_atomic_helper.py rename to numba_dpex/experimental/dpcpp_iface/_spv_atomic_helper.py diff --git a/numba_dpex/core/kernel_interface/dpcpp_iface/atomic_ref.py b/numba_dpex/experimental/dpcpp_iface/atomic_ref.py similarity index 100% rename from numba_dpex/core/kernel_interface/dpcpp_iface/atomic_ref.py rename to numba_dpex/experimental/dpcpp_iface/atomic_ref.py diff --git a/numba_dpex/core/kernel_interface/dpcpp_iface/memory_enums.py b/numba_dpex/experimental/dpcpp_iface/memory_enums.py similarity index 100% rename from numba_dpex/core/kernel_interface/dpcpp_iface/memory_enums.py rename to numba_dpex/experimental/dpcpp_iface/memory_enums.py diff --git a/numba_dpex/core/types/dpcpp_types.py b/numba_dpex/experimental/dpcpp_types.py similarity index 100% rename from numba_dpex/core/types/dpcpp_types.py rename to numba_dpex/experimental/dpcpp_types.py