代码如下:
@ti.func
def init(a:int):
for i in range(a):
pass
@ti.kernel
def ttt(a:int):
init(a)
ti.init(ti.cuda)
ttt(5)
[Taichi] version 1.5.0, llvm 15.0.1, commit 7b885c28, win, python 3.8.8
cuda11.6,驱动版本512.15
报错:
8 init(a)
10 ti.init(ti.cuda)
---> 11 ttt(5)
File d:\Programs\Python\Python38\lib\site-packages\taichi\lang\kernel_impl.py:1023, in _kernel_impl..wrapped(*args, **kwargs)
1020 @functools.wraps(_func)
1021 def wrapped(*args, **kwargs):
1022 try:
-> 1023 return primal(*args, **kwargs)
1024 except (TaichiCompilationError, TaichiRuntimeError) as e:
1025 raise type(e)('\n' + str(e)) from None
File d:\Programs\Python\Python38\lib\site-packages\taichi\lang\shell.py:27, in _shell_pop_print..new_call(*args, **kwargs)
25 @functools.wraps(old_call)
26 def new_call(*args, **kwargs):
---> 27 ret = old_call(*args, **kwargs)
28 # print's in kernel won't take effect until ti.sync(), discussion:
29 # https://github.com/taichi-dev/taichi/pull/1303#discussion_r444897102
30 print(_ti_core.pop_python_print_buffer(), end='')
File d:\Programs\Python\Python38\lib\site-packages\taichi\lang\kernel_impl.py:950, in Kernel.__call__(self, *args, **kwargs)
948 impl.current_cfg().opt_level = 1
949 key = self.ensure_compiled(*args)
--> 950 return self.runtime.compiled_functions[key](*args)
File d:\Programs\Python\Python38\lib\site-packages\taichi\lang\kernel_impl.py:853, in Kernel.get_function_body..func__(*args)
851 except Exception as e:
852 e = handle_exception_from_cpp(e)
--> 853 raise e from None
855 ret = None
856 ret_dt = self.return_type
File d:\Programs\Python\Python38\lib\site-packages\taichi\lang\kernel_impl.py:850, in Kernel.get_function_body..func__(*args)
845 raise TaichiRuntimeError(
846 f"The number of elements in kernel arguments is too big! Do not exceed 64 on {_ti_core.arch_name(impl.current_cfg().arch)} backend."
847 )
849 try:
--> 850 t_kernel(launch_ctx)
851 except Exception as e:
852 e = handle_exception_from_cpp(e)
RuntimeError: [jit_cuda.cpp:taichi::lang::convert@67] Assertion failure: std::isalpha(new_name[i]) || std::isdigit(new_name[i]) || new_name[i] == '_' || new_name[i] == '.'