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

Support for(let i = start; i < begin; i += stride) in kernels #4

Open
AmesingFlank opened this issue Apr 22, 2022 · 0 comments
Open

Comments

@AmesingFlank
Copy link
Owner

Taichi.js currently only supports range-for loops:

for(let i of range(n)){
  ...
}

and while-loops:

while(cond){
 ...
}

A top-level range-for loop in a kernel will be parallelised. All while-loops will be serial.

We should also support traditional for loops of the form

for(let i = start; i < begin; i += stride){
...
}

And we should implement them by translating this into a while-loop.

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

1 participant