Harshita Kalani

Week 4 of GSoC 2024: Advancing Runtime and Backend Improvements

Hey, welcome back to my blog for week 4. This week, I continued with the runtime example of lfortran_intrinsic_sin I mentioned in the last blog. After tweaking the code in the compile-time file, it started working smoothly.
I also worked on implementing the optional arguments of minloc, which is still in progress. For the Fortran backend, I generalized the code to handle all intrinsics automatically, eliminating the need for explicit registration in the ASR to Fortran backend. Additionally, I identified and reviewed issues related to intrinsic functions and reviewed corresponding PRs.
The next day, I implemented all the functions in the IEEE arithmetic module from scratch in the runtime library, ensuring they are fully functional.
Alongside handling intrinsics, I began working on SNAP compilation by installing SNAP and reviewing the files to understand the process. This will continue in the upcoming weeks.
I then picked the cshift (circular shift for arrays) intrinsic and implemented it from scratch. I also looked for workarounds for the len_trim, trim, and achar functions.
I addressed the issue mentioned in the last blog about returning an array output for an array input for intrinsic elemental functions. One of my mentors suggested an approach related to the array_op pass, which I'll be working on in the upcoming weeks.
For the len_trim and trim functions, I'm stuck on an issue related to generics, which I'll try to resolve next week. I created a workaround for the null string issue in the achar intrinsic and completed the PR.
For the upcoming week, I plan to work on the following tasks:

  • Implement the remaining intrinsics
  • Work on the array_op pass for elemental intrinsics
  • Continue working on SNAP compilation
  • Find workarounds for the len_trim and trim functions
  • Generalize intrinsic registration in the ASR to C, C++, and Julia backend
Progress tracker: #4017.
Overall, I found this week's work engaging and am grateful to Ondřej Čertík and the rest of the mentors at LFortran for their constant reviews and suggestions. I look forward to next week and am eager to complete the planned tasks.

Here's a link to related blogs:
GSoC: Week 1
GSoC: Week 2
GSoC: Week 3
GSoC: Week 5