rise-lang / shine

The Shine compiler for the RISE language
https://rise-lang.org
MIT License
73 stars 8 forks source link

Experiment with host code generation on old GPGPU 2020 benchmarks #230

Open Bastacyclop opened 2 years ago

Bastacyclop commented 2 years ago

Previously I wrote about 1000 lines of host code by hand, now we can generate host code automatically instead (about 1200 lines).

  1. I did not try running the code yet
  2. I had to implement some hack to counter the fact that two unified nats may not have equal normal forms after type inference (the problem was there before and is completely orthogonal)
  3. I had to replace global temporary memory with local temporary memory, as support for global temporary memory has not yet been implemented
  4. I had to convert vectorized temporaries to scalar temporaries, as support for vectorized temporaries has not yet been implemented
  5. I changed memory hoisting to allow hoisting local memory outside of a mapGlobal, but the implementation will not work in the general case, its just a quick hack
  6. if we merge this PR, we would end up with 3 different Harris applications in the codebase, which is a bit messy. things could be factorized.
Bastacyclop commented 2 years ago

Things to do before merging, matching the points listed above:

  1. run the code to check for correctness
  2. could be merged separately
  3. add support for temporary global memory
  4. add support for vectorized temporaries
  5. open an issue for this and revert the hack #235
  6. document why there are three different Harris versions