Skip to content

Conversation

@MrBurmark
Copy link
Member

Summary

Fix the cuda and hip matrix tutorial. Fix spacing, add proper synchronization, map threads properly in teams implementation.

@MrBurmark MrBurmark requested review from a team and artv3 September 21, 2025 17:24
@artv3
Copy link
Member

artv3 commented Sep 21, 2025

I think we also need to clean up the description of the problem to highlight the transpose of the indices as well as the CPU implementations to make it consistent with the gpu versions.

@artv3
Copy link
Member

artv3 commented Sep 21, 2025

Thanks for getting this started @MrBurmark. I took a follow up pass; but I think I could use a second set of eyes on the Kernel implementation. Would anyone in @LLNL/raja-core be able to take a look?

RAJA::loop_icount<hip_threads_x>(ctx, row_tile, [&] (int col, int tx) {

d_Atview(col, row) = Tile_Array[ty][tx];
d_Atview(row, col) = Tile_Array[tx][ty];
Copy link
Member

Choose a reason for hiding this comment

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

@MrBurmark , I switched it around so its clear that the x and y threads have been transposed in shared memory. I'm not too sure how to express that in Kernel.

Copy link
Member Author

Choose a reason for hiding this comment

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

Would it be more clear to call row and col here rowt and colt?

Copy link
Member

Choose a reason for hiding this comment

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

good idea!

Copy link
Member

Choose a reason for hiding this comment

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

using row_t and col_t was the source of the compilation error. I switched it back so code compiles. Please feel free to undo my change and fix the compile differently.

@rhornung67 rhornung67 added this to the Dec 2025 Release milestone Nov 11, 2025
@rhornung67
Copy link
Member

rhornung67 commented Dec 8, 2025

@artv3 I think you've taken over this PR. There are come compilation issues that are causing the CI checks to fail. Can you get to them or should I try to find time to fix them? I assume we want this in the release.

@artv3
Copy link
Member

artv3 commented Dec 10, 2025

@artv3 I think you've taken over this PR. There are come compilation issues that are causing the CI checks to fail. Can you get to them or should I try to find time to fix them? I assume we want this in the release.

I can take a look, but I don't think this should hold up the release.

@rhornung67
Copy link
Member

@MrBurmark @artv3 I fixed the compilation errors in this, but the results are wrong.....

Copy link
Member

@rhornung67 rhornung67 left a comment

Choose a reason for hiding this comment

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

The code generates the wrong results. Either the code is wrong or the check result method is wrong. I haven't dug into this.

There are also other changes that could improve this and remove some confusion. For example, the printResult() routine assumes that the matrix passed in is At but the first call in the code (that can be commented out) is A. I would print out which matrix is being printed in a statement before each printResult() call and make the print method not name the matrix.

@artv3
Copy link
Member

artv3 commented Dec 10, 2025

I think we also have some inconsistent expression for the CPU RAJA::kernel examples. That is one thing that I needed to revisit.

@rhornung67
Copy link
Member

If I can find a few spare minutes, I will work on it. But, I can't promise I will get to it.

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.

Matrix Transpose Tutorial Cleanup

4 participants