exo-lang / exo

Exocompilation for productive programming of hardware accelerators
https://exo-lang.dev
MIT License
279 stars 28 forks source link

Add restrict qualifier to pointers at codegen #645

Open SamirDroubi opened 2 months ago

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.99%. Comparing base (88a6853) to head (02d076b).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #645 +/- ## ======================================= Coverage 86.99% 86.99% ======================================= Files 94 94 Lines 22022 22022 ======================================= Hits 19159 19159 Misses 2863 2863 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

yamaguchi1024 commented 2 months ago

Is this really safe? IIUC there's some code (like syr) that actually aliases the call to Exo kernels. Also, did you see any speedup from changing this?

SamirDroubi commented 2 months ago

Is this really safe? IIUC there's some code (like syr) that actually aliases the call to Exo kernels. Also, did you see any speedup from changing this?

It is safe from the Exo semantics since we enforce no-aliasing. In syr, we are cheating by doing that. However, in that particular example, i don't see how it can cause any issues since the two buffers that alias are ready-only. In any case, the correctness tests pass and we plan to fix the syr code anyways at some point.

And yes you do get a speedup.

skeqiqevian commented 2 months ago

What was the reason we needed aliasing for syr again? Is it so that you can perform stage_mem correctly on only one of the vectors without impacting the other?