Skip to content

Commit d9794c1

Browse files
committed
Move config.py into numba_dpex/core and fix circular imports
1 parent 2d62917 commit d9794c1

File tree

21 files changed

+27
-22
lines changed

21 files changed

+27
-22
lines changed

numba_dpex/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def parse_sem_version(version_string: str) -> Tuple[int, int, int]:
100100

101101
# Re-export types itself
102102
import numba_dpex.core.types as types # noqa E402
103-
from numba_dpex import config # noqa E402
103+
from numba_dpex.core import config # noqa E402
104104
from numba_dpex.core.kernel_interface.indexers import ( # noqa E402
105105
NdRange,
106106
Range,

numba_dpex/core/caching.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from numba.core.caching import CacheImpl, IndexDataCacheFile
99

10-
from numba_dpex import config
10+
from numba_dpex.core import config
1111

1212

1313
class _CacheImpl(CacheImpl):

numba_dpex/core/codegen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from numba.core import utils
1010
from numba.core.codegen import CPUCodegen, CPUCodeLibrary
1111

12-
from numba_dpex import config
12+
from numba_dpex.core import config
1313

1414
SPIR_TRIPLE = {32: " spir-unknown-unknown", 64: "spir64-unknown-unknown"}
1515

numba_dpex/core/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from numba.core import types as numba_types
99
from numba.core.compiler_lock import global_compiler_lock
1010

11-
from numba_dpex import config
11+
from numba_dpex.core import config
1212
from numba_dpex.core.exceptions import (
1313
KernelHasReturnValueError,
1414
UnreachableError,

numba_dpex/core/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ def __getattr__(name):
7777
# a kernel decorated function
7878
DEBUG_KERNEL_LAUNCHER = _readenv("NUMBA_DPEX_DEBUG_KERNEL_LAUNCHER", int, 0)
7979

80-
# Flag to enable caching, set NUMBA_DPEX_ENABLE_CACHE=0 to turn off.
80+
# Flag to enable caching, set NUMBA_DPEX_ENABLE_CACHE=0 to turn it off.
8181
ENABLE_CACHE = _readenv("NUMBA_DPEX_ENABLE_CACHE", int, 1)
8282
# To specify the default cache size, 20 by default.
8383
CACHE_SIZE = _readenv("NUMBA_DPEX_CACHE_SIZE", int, 20)
84-
# Enable debugging of cahcing mechanism, set 1 to turn it off.
84+
# Enable debugging of cahcing mechanism, set 1 to turn it on.
8585
DEBUG_CACHE = _readenv("NUMBA_DPEX_DEBUG_CACHE", int, 0)
8686

8787
# Flag to turn on the ConstantSizeStaticLocalMemoryPass in the kernel pipeline.

numba_dpex/core/kernel_interface/dispatcher.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
from numba.core.types import Array as NpArrayType
1313
from numba.core.types import void
1414

15-
from numba_dpex import NdRange, Range, config
15+
from numba_dpex import NdRange, Range
16+
from numba_dpex.core import config
1617
from numba_dpex.core.caching import LRUCache, NullCache
1718
from numba_dpex.core.descriptor import dpex_kernel_target
1819
from numba_dpex.core.exceptions import (

numba_dpex/core/kernel_interface/func.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from numba.core import sigutils, types
66
from numba.core.typing.templates import AbstractTemplate, ConcreteTemplate
77

8-
from numba_dpex import config
8+
from numba_dpex.core import config
99
from numba_dpex.core.caching import LRUCache, NullCache
1010
from numba_dpex.core.compiler import compile_with_dpex
1111
from numba_dpex.core.descriptor import dpex_kernel_target

numba_dpex/core/kernel_interface/spirv_kernel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
from numba.core import ir
99

10-
from numba_dpex import config, spirv_generator
10+
from numba_dpex import spirv_generator
11+
from numba_dpex.core import config
1112
from numba_dpex.core.compiler import compile_with_dpex
1213
from numba_dpex.core.exceptions import UncompiledKernelError, UnreachableError
1314
from numba_dpex.core.targets.kernel_target import DpexKernelTargetContext

numba_dpex/core/parfors/kernel_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from numba.parfors import parfor
2626

2727
import numba_dpex as dpex
28-
from numba_dpex import config
28+
from numba_dpex.core import config
2929

3030
from ..descriptor import dpex_kernel_target
3131
from ..types import DpnpNdArray, USMNdArray

numba_dpex/core/parfors/parfor_lowerer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
get_parfor_outputs,
1313
)
1414

15-
from numba_dpex import config
15+
from numba_dpex.core import config
1616
from numba_dpex.core.datamodel.models import (
1717
dpex_data_model_manager as kernel_dmm,
1818
)

0 commit comments

Comments
 (0)