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

Vectorize an inner loop that depends on the outer loop #197

Open
abdouskamel opened this issue Mar 21, 2019 · 0 comments
Open

Vectorize an inner loop that depends on the outer loop #197

abdouskamel opened this issue Mar 21, 2019 · 0 comments

Comments

@abdouskamel
Copy link
Contributor

Hello,

Actually that's not an issue but a question concerning Tiramisu. I don't know if it's the right place for asking questions, thus I'm sorry if it's inconvenient.

I want to implement a computation that looks like this with tiramisu :

for (i = 0; i < N; ++i)
    for (j = 0; j < i; ++j)
        S0
    S1

I have done it following the tutorials, but now I want to apply vectorization to the loop j with vector length v. The problem is that, as stated in the documentation :

the vectorization of a loop that has less than v iterations is not correct.

Thus, for the first iterations where i < v, the vectorization will be incorrect because the loop j iterates for less than v iterations. I think that this can be fixed by splitting the outer loop like that :

for (i = 0; i < v; ++i)
    for (j = 0; j < i; ++j)
        S0
    S1

for (i = v; i < N; ++i)
    for (j = 0; j < i; ++j)
        S0
    S1

and apply vectorization only to the second loop. This can be done easily in the declaration of the algorithm (layer 1), but I think that I must resolve this issue in layer 2 because it's an issue related to the optimization of the algorithm.

I searched in the documentation but didn't find a way to do that, so I am asking for your help.

Thank you.

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