You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that taichi complains about the return type.
To Reproduce
Please post a minimal sample code to reproduce the bug.
The developer team will put a higher priority on bugs that can be reproduced within 20 lines of code. If you want a prompt reply, please keep the sample code short and representative.
importtaichiastiti.init(arch=ti.cpu, default_fp=ti.f64, default_ip=ti.i64)
vec4=ti.math.vec3mat32=ti.types.matrix(3, 2, float)
@ti.kerneldefget_element(mat: mat32, i: ti.i32) ->float:
returnmat[0, i]
# error goes away if change to the following. But this would be very inconvenient.# return mat[ti.i32(0), i]m=mat32([[1,2], [3,4], [5,6]])
get_element(m, 0)
Log/Screenshots
Please post the full log of the program (instead of just a few lines around the error message, unless the log is > 1000 lines). This will help us diagnose what's happening. For example:
$ python my_sample_code.py
[Taichi] version 1.7.3, llvm 15.0.4, commit 5ec301be, linux, python 3.10.12
[Taichi] Starting on arch=x64
[E 02/21/25 22:42:33.872 225480] [type_check.cpp:visit@161] Assertion failure: stmt->offset->ret_type.get_element_type()->is_primitive( PrimitiveTypeID::i32)
Traceback (most recent call last):
File "/data/weixu/code/hosim/notebooks/test.py", line 12, in <module>
get_element(m, 0)
File "/home/weixu/venvs/working/lib/python3.10/site-packages/taichi/lang/kernel_impl.py", line 1113, in wrapped
return primal(*args, **kwargs)
File "/home/weixu/venvs/working/lib/python3.10/site-packages/taichi/lang/kernel_impl.py", line 1045, in __call__
return self.launch_kernel(kernel_cpp, *args)
File "/home/weixu/venvs/working/lib/python3.10/site-packages/taichi/lang/kernel_impl.py", line 976, in launch_kernel
raise e from None
File "/home/weixu/venvs/working/lib/python3.10/site-packages/taichi/lang/kernel_impl.py", line 969, in launch_kernel
compiled_kernel_data = prog.compile_kernel(prog.config(), prog.get_device_caps(), t_kernel)
RuntimeError: [type_check.cpp:visit@161] Assertion failure: stmt->offset->ret_type.get_element_type()->is_primitive( PrimitiveTypeID::i32)
Additional comments
If possible, please also consider attaching the output of command ti diagnose. This produces the detailed environment information and hopefully helps us diagnose faster.
Describe the bug
It seems that taichi complains about the return type.
To Reproduce
Please post a minimal sample code to reproduce the bug.
The developer team will put a higher priority on bugs that can be reproduced within 20 lines of code. If you want a prompt reply, please keep the sample code short and representative.
Log/Screenshots
Please post the full log of the program (instead of just a few lines around the error message, unless the log is > 1000 lines). This will help us diagnose what's happening. For example:
Additional comments
If possible, please also consider attaching the output of command
ti diagnose
. This produces the detailed environment information and hopefully helps us diagnose faster.ti diagnose output
The text was updated successfully, but these errors were encountered: