Skip to content

Commit d3e1677

Browse files
committed
Don't pass target into order_by_target_specificity()
It is not used - this makes the difference between this version and the upstream more stark, and should prevent them being seen as interchangeable.
1 parent f5bef7e commit d3e1677

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

numba_cuda/numba/cuda/types/cuda_functions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,8 @@ def get_call_type(self, context, args, kws):
314314
context, self, args, kws, depth=self._depth
315315
)
316316

317-
from numba.cuda.descriptor import cuda_target
318-
319317
order = utils.order_by_target_specificity(
320-
cuda_target, self.templates, fnkey=self.key[0]
318+
self.templates, fnkey=self.key[0]
321319
)
322320

323321
self._depth += 1

numba_cuda/numba/cuda/typing/context.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,7 @@ def core(typ):
290290
def find_matching_getattr_template(self, typ, attr):
291291
templates = list(self._get_attribute_templates(typ))
292292

293-
from numba.cuda.descriptor import cuda_target
294-
295-
order = order_by_target_specificity(cuda_target, templates, fnkey=attr)
293+
order = order_by_target_specificity(templates, fnkey=attr)
296294

297295
for template in order:
298296
return_type = template.resolve(typ, attr)

numba_cuda/numba/cuda/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def __hash__(self):
312312
return hash(tuple(sorted(self._values.items())))
313313

314314

315-
def order_by_target_specificity(target, templates, fnkey=""):
315+
def order_by_target_specificity(templates, fnkey=""):
316316
"""This orders the given templates from most to least specific against the
317317
current "target". "fnkey" is an indicative typing key for use in the
318318
exception message in the case that there's no usable templates for the
@@ -346,7 +346,7 @@ def key(x):
346346
if not order:
347347
msg = (
348348
f"Function resolution cannot find any matches for function "
349-
f"'{fnkey}' for the current target: '{target}'."
349+
f"'{fnkey}'."
350350
)
351351
from numba.core.errors import UnsupportedError
352352

0 commit comments

Comments
 (0)