Created
March 16, 2023 10:33
-
-
Save jarmitage/4725f55a49063f05677aaae9078289ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import taichi as ti | |
ti.init() | |
n = 16 | |
x = ti.field(ti.i32) | |
dyn = ti.root.dynamic(ti.i, n).place(x) | |
@ti.kernel | |
def add_data(): | |
for i in range(10): | |
x.append(i) | |
print(x.length(), x[i]) # will print i | |
for i in range(10): | |
x.deactivate() | |
print(x.length()) # will print 0 | |
add_data() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment