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

[type] Support offset load in bit vectorized loop #2127

Merged
merged 17 commits into from
Dec 31, 2020

Conversation

TH3CHARLie
Copy link
Collaborator

@TH3CHARLie TH3CHARLie marked this pull request as draft December 28, 2020 22:22
@TH3CHARLie TH3CHARLie marked this pull request as ready for review December 31, 2020 07:35
Copy link
Member

@yuanming-hu yuanming-hu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!! Looks great. Just a few minor comments.

tests/python/test_bit_array_vectorization.py Outdated Show resolved Hide resolved
tests/python/test_bit_array_vectorization.py Outdated Show resolved Hide resolved
tests/python/test_bit_array_vectorization.py Show resolved Hide resolved
ti.bit_vectorize(32)
for i, j in x:
y[i, j] = x[i, j + 1]
z[i, j] = x[i, j - 1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are ready, we can test x[i - 1, j]/x[i + 1, j] too. You can also allocate only the y field, and reuse the functions assign_vectorized and verify by adding template arguments dx: ti.template(), dy: ti.template(), and the loop bodies should be something like y[i, j] = x[i + dx, j + dy].

taichi/transforms/bit_loop_vectorize.cpp Outdated Show resolved Hide resolved
@TH3CHARLie
Copy link
Collaborator Author

Thanks for the review and help along the way!

Copy link
Member

@yuanming-hu yuanming-hu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! LGTM now. Thanks for the hard work!

@yuanming-hu yuanming-hu merged commit 5d049ab into taichi-dev:master Dec 31, 2020
@TH3CHARLie TH3CHARLie deleted the offset-load branch December 31, 2020 22:18
@k-ye k-ye mentioned this pull request Jan 5, 2021
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

Successfully merging this pull request may close these issues.

3 participants