Wrap hipMalloc/hipMemcpy interfaces to 132 columns (ifort support)#388
Merged
Merged
Conversation
hipfort_hipmalloc.F90 and hipfort_hipmemcpy.F90 are the hand-written interface files; unlike the generated bindings (already wrapped), they still contained free-form source lines up to 259 columns. The classic Intel Fortran compiler (ifort) caps free-form lines at 132 columns with no extension option, so these files prevented an ifort build (see ROCm#123). Wrap the over-long lines to <=132 columns: - code lines are broken after a comma (outside string literals), with the continuation indented, which reads naturally; - long ERROR STOP messages are split into concatenated string literals ("..." // "..."), a constant expression, so the message is unchanged. Each wrap was verified to reconstruct the original statement exactly (comma breaks are byte-identical after continuation processing; the split ERROR STOP strings concatenate back to the original text). The whole lib/hipfort tree compiles with gfortran under -ffree-line-length-132 -Werror=line-truncation, i.e. within ifort's hard 132-column limit.
amontoison
force-pushed
the
wrap-hand-written-interfaces
branch
from
July 25, 2026 00:34
53eb7f5 to
3ae87e9
Compare
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The generated bindings were already wrapped to 132 columns, but the two hand-written interface files were not:
lib/hipfort/hipfort_hipmalloc.F90lib/hipfort/hipfort_hipmemcpy.F90The classic Intel Fortran compiler (
ifort) caps free-form source lines at 132 columns with no option to extend them, so these two files were the last thing preventing anifortbuild (see #123).Change
Wrap the over-long lines to ≤132 columns, in a readable way:
ERROR STOPmessages are split into concatenated string literals ("..." // "..."), which is a constant expression, so the message text is unchanged.(390 lines broken after commas, 315 strings split, across the two files.) No logic changes.
Verification
ERROR STOPstrings concatenate back to the original text.lib/hipfort/now exceeds 132 columns.lib/hipforttree compiles with gfortran under-ffree-line-length-132 -Werror=line-truncation, i.e. within ifort's hard 132-column limit (a direct proxy, since no Intel compiler was available in the test environment).Follow-up
With this merged,
cmake/toolchains/intel-classic.cmake(added in #347) can drop its "lines longer than 132 columns → build may fail" warning.