Skip to content

Commit 36f30ef

Browse files
just remove literal from banlist instead
1 parent f210837 commit 36f30ef

File tree

3 files changed

+3
-31
lines changed

3 files changed

+3
-31
lines changed

numba_cuda/numba/cuda/__init__.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -66,33 +66,3 @@
6666
)
6767

6868
from numba.cuda.np.ufunc import vectorize, guvectorize
69-
70-
71-
_lazy_exports = {
72-
"literal_unroll": ("numba.cuda.misc.special", "literal_unroll"),
73-
"literal": ("numba.cuda.misc", "literal"),
74-
}
75-
76-
__all__ = list(globals().get("__all__", [])) + list(_lazy_exports.keys())
77-
78-
79-
def __getattr__(name):
80-
"""
81-
Lazily import a few attrs that might import lowering
82-
"""
83-
if name in _lazy_exports:
84-
mod_name, attr_name = _lazy_exports[name]
85-
try:
86-
module = importlib.import_module(mod_name)
87-
value = getattr(module, attr_name)
88-
except Exception as exc:
89-
raise ImportError(
90-
f"could not import name {attr_name!r} from {mod_name!r}"
91-
) from exc
92-
globals()[name] = value
93-
return value
94-
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
95-
96-
97-
def __dir__():
98-
return sorted(set(list(globals().keys()) + list(_lazy_exports.keys())))

numba_cuda/numba/cuda/device_init.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@
8787
PTXSource,
8888
)
8989

90+
from numba.cuda.misc.special import literal_unroll
91+
from numba.cuda.misc import literal
92+
9093
reduce = Reduce = reduction.Reduce
9194

9295
# Expose vector type constructors and aliases as module level attributes.

numba_cuda/numba/cuda/tests/nocuda/test_import.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def test_no_impl_import(self):
3838
"numba.cuda.python.printimpl",
3939
"numba.cuda.core.optional",
4040
"numba.cuda.misc.gdb_hook",
41-
"numba.cuda.misc.literal",
4241
"numba.cuda.misc.cffiimpl",
4342
"numba.np.linalg",
4443
"numba.np.polynomial",

0 commit comments

Comments
 (0)