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

Add UnrolledLoop transformation to ArrayAssignment2LoopsTrans: ArrayAssignment2UnrolledLoopsTrans #2731

Open
hbrunie opened this issue Oct 2, 2024 · 2 comments
Assignees
Labels
enhancement PSyIR Core PSyIR functionality

Comments

@hbrunie
Copy link
Collaborator

hbrunie commented Oct 2, 2024

@sergisiso @arporter , our Poseidon uplifter works well with simplified Kernel: Perfectly Nested loop with "simple" assignments inside.

Some of FlashX code (and probably other out there like Nemo) use a lot of arrays notations.
These notations can be transformed to simple Loop with the PsyIR ArrayAssignment2LoopsTrans, nevertheless, this adds some loops inside of a nice well defined Kernel.

Thus I thought of extending this transformation. This could be a new one just wrapping the first one and unrolling the loop.
Indeed in this case we know where this loop comes from and it seems safe to unroll it.

Tell me if such a transformation would be useful elsewhere.
Cheers,
Hugo

@hbrunie hbrunie added enhancement PSyIR Core PSyIR functionality labels Oct 2, 2024
@hbrunie hbrunie self-assigned this Oct 2, 2024
@hbrunie
Copy link
Collaborator Author

hbrunie commented Oct 2, 2024

I just ran into a more complex case where the array bounds are not known at compile time. So not sure if this transformation would be useful in many cases ...
In FlashX they do:
integer, dimension(3), intent(in) :: logc
real, dimension(logc(3):,:,logc(1):,logc(2):), intent(inout) :: uin

@hbrunie
Copy link
Collaborator Author

hbrunie commented Oct 7, 2024

As @sergisiso suggested, this could be a Transformation on its own. Just applying when bounds are well known.

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

No branches or pull requests

1 participant