Harshita Kalani

Week 7 of GSoC 2024: Tackling Intrinsic Functions and Compilation Challenges

Hey there, I'm back with another blog post. This week, I focused on updating the integration tests for several intrinsics like epsilon, precision, ior, ieor, and iand. I opened issues for the bugs found in them and added support for handling array input to inquiry functions.
I added tests for not, or, and, and xor and realized that these intrinsics are implemented through mapping with ior, iand, and ieor, which do not support logical arguments. I opened an issue for that and will address them.
I then examined selected_real_kind, selected_int_kind, and selected_char_kind and found that these intrinsics only support scalar input and need refactoring. An issue has been opened for that as well.
Next, I looked into tiny and huge and found issues related to arithmetic overflow. I addressed these issues and opened a PR to add tests for maxexponent, minexponent, radix, range, and hypot, solving related issues. Maxexponent and minexponent were implemented as elemental functions, but they are actually inquiry functions, so I refactored them.
Additionally, I updated the automatic Python script to ensure that the kind of the arguments in various intrinsics are equal. I've maintained a track of this here: #3067.
I investigated issues encountered during compiling PRIMA, related to intrinsics such as support for the spread intrinsic function and the mask and back arguments for minloc and maxloc. I am currently working on implementing the spread intrinsic. The compile-time implementation is complete, and I will work on the runtime implementation next week.
Earlier, I worked on the optional arguments for minloc and maxloc. Some tests are failing with that implementation, so I will look into that as well.
I ended the week with a workaround for the real intrinsic, which was failing due to third-party code. I explored the issue but have yet to resolve it fully. For now, I made a workaround in the stdlib and opened an issue. With the workaround, the PR is now merged, but it needs proper refactoring to maintain performance.
For the upcoming week, I plan to work on the following tasks:

  • Complete the implementation of the spread intrinsic
  • Support mask and back arguments for minloc and maxloc
  • Add integration tests and resolve bugs related to intrinsics
  • Work on PRIMA and SNAP compilation
Progress tracker: #4017.
I found this week's work really exciting 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. Stay tuned for more updates!

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