Skip to content
New issue

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

关于“如何声明@ti.kernel中最外层循环串行”的解决方案 #1

Closed
Yousazoe opened this issue Oct 13, 2021 · 2 comments
Closed

Comments

@Yousazoe
Copy link

可以在外面加一个假循环串行最外层:

for _ in range(1): 
  for i in range(100):  # 串行
    ...
@0xrabbyte
Copy link
Owner

倒是我在太极图形课S1第03讲看到ti.init()中可以写一个cpu_max_num_thread=1来保证串行。但不知道如何单独运用到一个@ti.kernel中

@0xrabbyte
Copy link
Owner

Taichi v.1.0.0中提供了ti.loop_config(serialize=True)可以十分优雅地解决这个问题!😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants