Skip to content

Commit cc4682a

Browse files
committed
address more review comments
1 parent 184a529 commit cc4682a

File tree

12 files changed

+8
-572
lines changed

12 files changed

+8
-572
lines changed

numba_cuda/numba/cuda/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import warnings
88
import sys
99

10-
from numba_cuda._version import __version__
1110

1211
# Re-export types itself
1312
import numba.cuda.types as types
@@ -69,6 +68,3 @@
6968
)
7069

7170
from numba.cuda.np.ufunc import vectorize, guvectorize
72-
from numba.cuda.misc import quicksort, mergesort
73-
from numba.cuda.misc.special import literal_unroll
74-
from numba.cuda.np.numpy_support import *

numba_cuda/numba/cuda/core/ir.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
ConstantInferenceError,
2929
)
3030
from numba.cuda.core import consts
31-
from numba.cuda import HAS_NUMBA
3231

3332
# terminal color markup
3433
_termcolor = errors.termcolor()
@@ -783,7 +782,7 @@ def __init__(self, value, loc):
783782
if HAS_NUMBA:
784783
assert isinstance(loc, (Loc, numba.core.ir.Loc))
785784
else:
786-
assert isinstance(loc)
785+
assert isinstance(loc, (Loc))
787786
self.value = value
788787
self.loc = loc
789788

numba_cuda/numba/cuda/core/untyped_passes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
SSACompliantMixin,
1313
register_pass,
1414
)
15+
from numba import cuda
1516
from numba.cuda.core import postproc, bytecode, transforms, inline_closurecall
1617
from numba.cuda.core import (
1718
errors,
@@ -632,8 +633,6 @@ def __init__(self):
632633
FunctionPass.__init__(self)
633634

634635
def run_pass(self, state):
635-
from numba import njit
636-
637636
func_ir = state.func_ir
638637
mutated = False
639638
for idx, blk in func_ir.blocks.items():
@@ -669,7 +668,7 @@ def run_pass(self, state):
669668
continue
670669

671670
pyfunc = convert_code_obj_to_function(node, func_ir)
672-
func = njit()(pyfunc)
671+
func = cuda.jit()(pyfunc)
673672
new_node = ir.Global(
674673
node.code.co_name, func, stmt.loc
675674
)

numba_cuda/numba/cuda/cpython/listobj.py

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
RefType,
2020
)
2121
from numba.cuda.extending import overload_method, overload
22-
from numba.cuda.misc import quicksort
2322
from numba.cuda.cpython import slicing
24-
from numba.cuda import literal_unroll
23+
from numba.cuda.misc.special import literal_unroll
2524

2625
registry = Registry("listobj")
2726
lower = registry.lower
@@ -1132,17 +1131,6 @@ def gt(a, b):
11321131
return a > b
11331132

11341133

1135-
sort_forwards = quicksort.make_jit_quicksort().run_quicksort
1136-
sort_backwards = quicksort.make_jit_quicksort(lt=gt).run_quicksort
1137-
1138-
arg_sort_forwards = quicksort.make_jit_quicksort(
1139-
is_argsort=True, is_list=True
1140-
).run_quicksort
1141-
arg_sort_backwards = quicksort.make_jit_quicksort(
1142-
is_argsort=True, lt=gt, is_list=True
1143-
).run_quicksort
1144-
1145-
11461134
def _sort_check_reverse(reverse):
11471135
if isinstance(reverse, types.Omitted):
11481136
rty = reverse.value
@@ -1168,35 +1156,6 @@ def _sort_check_key(key):
11681156
raise errors.TypingError(msg)
11691157

11701158

1171-
@overload_method(types.List, "sort")
1172-
def ol_list_sort(lst, key=None, reverse=False):
1173-
_sort_check_key(key)
1174-
_sort_check_reverse(reverse)
1175-
1176-
if cgutils.is_nonelike(key):
1177-
KEY = False
1178-
sort_f = sort_forwards
1179-
sort_b = sort_backwards
1180-
elif isinstance(key, types.Dispatcher):
1181-
KEY = True
1182-
sort_f = arg_sort_forwards
1183-
sort_b = arg_sort_backwards
1184-
1185-
def impl(lst, key=None, reverse=False):
1186-
if KEY is True:
1187-
_lst = [key(x) for x in lst]
1188-
else:
1189-
_lst = lst
1190-
if reverse is False or reverse == 0:
1191-
tmp = sort_f(_lst)
1192-
else:
1193-
tmp = sort_b(_lst)
1194-
if KEY is True:
1195-
lst[:] = [lst[i] for i in tmp]
1196-
1197-
return impl
1198-
1199-
12001159
@overload(sorted)
12011160
def ol_sorted(iterable, key=None, reverse=False):
12021161
if not isinstance(iterable, types.IterableType):

numba_cuda/numba/cuda/misc/mergesort.py

Lines changed: 0 additions & 124 deletions
This file was deleted.

0 commit comments

Comments
 (0)