А во вторых мне кажется что Cuda - это не то место где работают с буквами.блин а тогда чем можно работать чтобы подключить видюху к скрипту
Traceback (most recent call last):
File "C:\Python36\lib\site-packages\numba\core\errors.py", line 744, in new_error_context
yield
File "C:\Python36\lib\site-packages\numba\core\lowering.py", line 230, in lower_block
self.lower_inst(inst)
File "C:\Python36\lib\site-packages\numba\core\lowering.py", line 378, in lower_inst
self.lower_print(inst)
File "C:\Python36\lib\site-packages\numba\core\lowering.py", line 734, in lower_print
impl(self.builder, argvals)
File "C:\Python36\lib\site-packages\numba\core\base.py", line 1165, in __call__
res = self._imp(self._context, builder, self._sig, args, loc=loc)
File "C:\Python36\lib\site-packages\numba\core\base.py", line 1195, in wrapper
return fn(*args, **kwargs)
File "C:\Python36\lib\site-packages\numba\cuda\printimpl.py", line 66, in print_varargs
argfmt, argvals = print_item(argtype, context, builder, argval)
File "C:\Python36\lib\functools.py", line 807, in wrapper
return dispatch(args[0].__class__)(*args, **kw)
File "C:\Python36\lib\site-packages\numba\cuda\printimpl.py", line 23, in print_item
% (ty,))
NotImplementedError: printing unimplemented for values of type [unichr x 1]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "cudaProc.py", line 18, in <module>
my_kernel[blockspergrid, threadsperblock](array_cuda)
File "C:\Python36\lib\site-packages\numba\cuda\compiler.py", line 822, in __call__
self.stream, self.sharedmem)
File "C:\Python36\lib\site-packages\numba\cuda\compiler.py", line 964, in call
kernel = _dispatcher.Dispatcher._cuda_call(self, *args)
File "C:\Python36\lib\site-packages\numba\cuda\compiler.py", line 972, in _compile_for_args
return self.compile(tuple(argtypes))
File "C:\Python36\lib\site-packages\numba\cuda\compiler.py", line 1094, in compile
**self.targetoptions)
File "C:\Python36\lib\site-packages\numba\core\compiler_lock.py", line 35, in _acquire_compile_lock
return func(*args, **kwargs)
File "C:\Python36\lib\site-packages\numba\cuda\compiler.py", line 511, in __init__
inline=inline)
File "C:\Python36\lib\site-packages\numba\core\compiler_lock.py", line 35, in _acquire_compile_lock
return func(*args, **kwargs)
File "C:\Python36\lib\site-packages\numba\cuda\compiler.py", line 53, in compile_cuda
locals={})
File "C:\Python36\lib\site-packages\numba\core\compiler.py", line 606, in compile_extra
return pipeline.compile_extra(func)
File "C:\Python36\lib\site-packages\numba\core\compiler.py", line 353, in compile_extra
return self._compile_bytecode()
File "C:\Python36\lib\site-packages\numba\core\compiler.py", line 415, in _compile_bytecode
return self._compile_core()
File "C:\Python36\lib\site-packages\numba\core\compiler.py", line 395, in _compile_core
raise e
File "C:\Python36\lib\site-packages\numba\core\compiler.py", line 386, in _compile_core
pm.run(self.state)
File "C:\Python36\lib\site-packages\numba\core\compiler_machinery.py", line 339, in run
raise patched_exception
File "C:\Python36\lib\site-packages\numba\core\compiler_machinery.py", line 330, in run
self._runPass(idx, pass_inst, state)
File "C:\Python36\lib\site-packages\numba\core\compiler_lock.py", line 35, in _acquire_compile_lock
return func(*args, **kwargs)
File "C:\Python36\lib\site-packages\numba\core\compiler_machinery.py", line 289, in _runPass
mutated |= check(pss.run_pass, internal_state)
File "C:\Python36\lib\site-packages\numba\core\compiler_machinery.py", line 262, in check
mangled = func(compiler_state)
File "C:\Python36\lib\site-packages\numba\core\typed_passes.py", line 463, in run_pass
NativeLowering().run_pass(state)
File "C:\Python36\lib\site-packages\numba\core\typed_passes.py", line 384, in run_pass
lower.lower()
File "C:\Python36\lib\site-packages\numba\core\lowering.py", line 136, in lower
self.lower_normal_function(self.fndesc)
File "C:\Python36\lib\site-packages\numba\core\lowering.py", line 190, in lower_normal_function
entry_block_tail = self.lower_function_body()
File "C:\Python36\lib\site-packages\numba\core\lowering.py", line 216, in lower_function_body
self.lower_block(block)
File "C:\Python36\lib\site-packages\numba\core\lowering.py", line 230, in lower_block
self.lower_inst(inst)
File "C:\Python36\lib\contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Python36\lib\site-packages\numba\core\errors.py", line 751, in new_error_context
raise newerr.with_traceback(tb)
numba.core.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend)
←[1m←[1mprinting unimplemented for values of type [unichr x 1]
←[1m
File "cudaProc.py", line 13:←[0m
←[1mdef my_kernel(array):
<source elided>
for i in range(len(array)):
←[1m print(array[i])
←[0m ←[1m^←[0m←[0m
←[0m
←[0m←[1mDuring: lowering "print($18.5)" at cudaProc.py (13)←[0m
from __future__ import division
from numba import cuda
import numpy as np
import math
lst = np.array(['1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'],dtype='<U1')
array_cuda = cuda.to_device(lst)
@cuda.jit()
def my_kernel(array):
for i in range(len(array)):
print(array[i])
if __name__ == '__main__':
threadsperblock = 128
blockspergrid = math.ceil(lst.shape[0] / threadsperblock)
my_kernel[blockspergrid, threadsperblock](array_cuda)
def func(args,args1,addfind):
count=0
for i in range(len(args)):
for n in range(len(args)):
for j in range(len(args)):
for k in range(len(args)):
for l in range(len(args)):
for h in range(len(args)):
for b in range(len(args)):
for o in range(len(args)):
for p in range(len(args)):
for e in range(len(args)):
for d in range(len(args)):
for a in range(len(args)):
for c in range(len(args)):
for f in range(len(args)):
for m in range(len(args)):
for y in range(len(args)):
key =f'{args[y]}{args[m]}{args[f]}{args[c]}{args[a]}{args[d]}{args[e]}{args[p]}{args1[p]}{args1[e]}{args1[d]}{args1[a]}{args1[c]}{args1[f]}{args1[m]}{args1[y]}'
dec = int(key, 16)
print(f"{key} | count: {count} ",end="\r")
count+=1