Repository navigation
Fix string support in CUDA target - #7052
Conversation
This fixes the following failure, which occurred because unicode typing and
lowering was not registered with the CUDA target:
```
======================================================================
ERROR: test_string (numba.cuda.tests.cudapy.test_print.TestPrint)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\work\numbadev\numba\numba\core\base.py", line 710, in cast
impl = self._casts.find((fromty, toty))
File "C:\work\numbadev\numba\numba\core\base.py", line 48, in find
out = self._find(sig)
File "C:\work\numbadev\numba\numba\core\base.py", line 57, in _find
raise NotImplementedError(self, sig)
NotImplementedError: (<numba.core.base.OverloadSelector object at 0x000001F7C7756160>, (Literal[str](hop!), unicode_type))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\work\numbadev\numba\numba\core\errors.py", line 744, in new_error_context
yield
File "C:\work\numbadev\numba\numba\core\lowering.py", line 230, in lower_block
self.lower_inst(inst)
File "C:\work\numbadev\numba\numba\core\lowering.py", line 374, in lower_inst
self.lower_print(inst)
File "C:\work\numbadev\numba\numba\core\lowering.py", line 729, in lower_print
argvals = self.fold_call_args(fnty, sig, pos_args, inst.vararg, {})
File "C:\work\numbadev\numba\numba\core\lowering.py", line 680, in fold_call_args
argvals = [self._cast_var(var, sigty)
File "C:\work\numbadev\numba\numba\core\lowering.py", line 680, in <listcomp>
argvals = [self._cast_var(var, sigty)
File "C:\work\numbadev\numba\numba\core\lowering.py", line 663, in _cast_var
return self.context.cast(self.builder, val, varty, ty)
File "C:\work\numbadev\numba\numba\core\base.py", line 713, in cast
raise NotImplementedError(
NotImplementedError: Cannot cast Literal[str](hop!) to unicode_type: %".41" = load i8*, i8** %"$const16.6"
```
stuartarchibald
left a comment
There was a problem hiding this comment.
Thanks for the patch.
|
Buildfarm ID: |
Both of these passed. Given this error is likely transient, @gmarkall if this fixes it for you on a setup that reproduces it more regularly then I think this is fine. It makes sense logically given the changes made prior to this and there having been similar fixes for similar problems. |
|
@stuartarchibald Thanks - should this be "Buildfarm passed" now? |
Done! |
|
Note: once merged this should also sort out #6840 |
This fixes the following failure, which occurred because unicode typing and lowering was not registered with the CUDA target: