lanl / ports-of-call

Performance Portability Utilities
https://lanl.github.io/ports-of-call/
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Fortran Support #12

Open chadmeyer opened 2 years ago

chadmeyer commented 2 years ago

We need to have the ability to support similar things within ports-of-call on the Fortran side, for library codes that use ports-of-call and include Fortran libraries. This issue can serve as a place for discussion.

chadmeyer commented 2 years ago

There are multiple concerns surrounding this.

The first is that any preprocessor-based solutions would have to be broken out into files which do not contain anything but preprocessor directives (no code from another language or even comments not bracketed out by the preprocessor). That might require splitting out some of our code from

Second, compilers don't handle fortran and preprocessors universally, so there would need to be some way to make sure that if a code was consuming a forts-of-call bit, that the code is being handled correctly. I bet that could be handled in an automated way using cmake but I don't know how. And if someone wanted to consume it header only, we could at least provide some helpful hints.

Third, while preprocessors seem like the cleanest way to do this, Fortran modules might be the most Fortran way of doing it. Not sure whether that's an argument for or against, but I want to put it out there.

Fourth, we need to set a scope limit. Do we support only the Fortran equivalents to the typedefs here? Do we want to support decorating fortran wrappers where applicable? Obviously the issue surrounding float and double is the most pressing, but especially as we venture into OpenMP and OpenACC land, it becomes possible to define Fortran decorators as well.