-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loki: Always inline stmt functions from C-headers #105
Conversation
57a665d
to
418e0c0
Compare
Integration note: This requires a very recent Loki commit, which has not been tagged yet: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I agree, there is no need to keep the re-written one-line elemental functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Are the fcttre_mod.F90
and fccld_mod.F90
files still used anywhere? Otherwise I would suggest removing them.
# OFP frontend cannot deal with statement functions, so we toggle them here | ||
set( CLOUDSC_DEFINE_STMT_FUNC "" ) | ||
if(NOT "${LOKI_FRONTEND}" STREQUAL "ofp") | ||
set( CLOUDSC_DEFINE_STMT_FUNC CLOUDSC_STMT_FUNC ) | ||
endif() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Oh, the Loki upgrade in #100 has incurred a conflict, this branch needs a rebase now |
This removes a lot of the handholding needed for the C-specific transpile variant, where the utility functions where previously inlined from re-written elemental functions. Instead we now configure the Loki `InlineTransformation` to inline those, and force the CLOUDSC kernel to be preprocessed, so that we may find the comdeck functions. Note, I've left the source for the re-written elemental functions in the common directory for reference. If that becomes annoying, these can now be removed.
418e0c0
to
a0983f2
Compare
No they are not used anymore. Their equivalents in CUF-land are tho, so I left them in. I'll remove the original now, we can remove the CUD ones once the pipeline is adjusted there (sorry, did this one quickly). |
43431a7
to
fa1391b
Compare
This PR removes the use of the re-written one-line elemental functions that where used to facilitate inlining of the historical "commdeck" functions. This was a hard requirement for all flavours of C-transpilation. However, Loki can now also inline raw statement functions, if they have been internalised to the kernel via preprocessing. In this PR we now switch this on in the Loki config and remove the special treatment from the CMake config.
Note, I've also piggy-backed an update to the latest Loki version and the removal or a rogue import, that can cause problems.
Another note, I've also left the module-based elemental functions in the source, for reference, and because there are CUF-specific versions in the same place. I've only cleaned up the raw C-transpilation, but not yet any of CUF modes.