代码如下:
import taichi as ti
ti.init(arch=ti.gpu)
N=10
a=ti.field(dtype=int, shape=(N,))
b=ti.field(dtype=int, shape=(N,))
@ti.kernel
def test():
print(a[1]//b[1])
test()
运行结果为
[Taichi] version 1.7.0, llvm 15.0.1, commit 4eb2cff7, win, python 3.10.11 [Taichi] Starting on arch=cuda