alpaka-group / alpaka

Abstraction Library for Parallel Kernel Acceleration :llama:
https://alpaka.readthedocs.io
Mozilla Public License 2.0
356 stars 74 forks source link

Add 2D heat equation example #2365

Closed ikbuibui closed 2 months ago

ikbuibui commented 3 months ago

Adds a 2D heat equation example for the upcoming alpaka workshop. This example is supposed to show how alpaka should be used, best practices, etc. So comments and reviews are welcome and appreciated from all. This PR is a WIP but please review and comment in the state you find it in.

fwyzard commented 3 months ago

Just a thought: why not use the mdspan accessor for the 2D buffers ?

ikbuibui commented 3 months ago

Just a thought: why not use the mdspan accessor for the 2D buffers ?

This is a good point, and can be incorporated. Currently after a discussion with Rene we were of the opinion that since pitches are a frequent tripping point when dealing with 2d buffers and people in the workshop may not be very familiar with GPU programming, it might be good to not hide that behind mdspan. On the other hand, making the example simpler to understand is a good thing, so I am still not sure which way to go. I will bring this up in the next alpaka meeting for a small discussion.

mehmetyusufoglu commented 3 months ago

Just a thought: why not use the mdspan accessor for the 2D buffers ?

This is a good point, and can be incorporated. Currently after a discussion with Rene we were of the opinion that since pitches are a frequent tripping point when dealing with 2d buffers and people in the workshop may not be very familiar with GPU programming, it might be good to not hide that behind mdspan. On the other hand, making the example simpler to understand is a good thing, so I am still not sure which way to go. I will bring this up in the next alpaka meeting for a small discussion.

mdspan can be a second step. After showing the code with pitch / stride we can show mdspan.