We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import taichi as ti ti.init(arch=ti.cpu, offline_cache=True, offline_cache_file_path='one/path/to/cache') @ti.experimental.real_func def B(i: ti.i32): print(f'-> B ', end='') if i != 0: A(i - 1) @ti.experimental.real_func def A(i: ti.i32): print(f'-> A ', end='') if i != 0: B(i - 1) @ti.kernel def K1(i: ti.i32): print('K1 ', end='') A(i) print() @ti.kernel def K2(i: ti.i32): print('K2 ', end='') B(i) print() K1(5) K2(5)
import taichi as ti ti.init(arch=ti.cpu, offline_cache=True, offline_cache_file_path='one/path/to/cache') @ti.experimental.real_func def B(i: ti.i32): print(f'-> B ', end='') if i != 0: A(i - 1) @ti.experimental.real_func def A(i: ti.i32): # print(f'-> A ', end='') print(f'-> A^ ', end='') if i != 0: B(i - 1) @ti.kernel def K1(i: ti.i32): print('K1 ', end='') A(i) print() @ti.kernel def K2(i: ti.i32): print('K2 ', end='') B(i) print() K1(5) K2(5)
python t1.py
K1 -> A -> B -> A -> B -> A -> B K2 -> B -> A -> B -> A -> B -> A
python t2.py
# The output is wrong K1 -> A^ -> B -> A^ -> B -> A^ -> B K2 -> B -> A -> B -> A -> B -> A
K1 -> A^ -> B -> A^ -> B -> A^ -> B K2 -> B -> A^ -> B -> A^ -> B -> A^
The text was updated successfully, but these errors were encountered:
No branches or pull requests
t1.py
t2.py
run
python t1.py
Then, run
python t2.py
The text was updated successfully, but these errors were encountered: