Skip to content

Add Fortran test using activity descriptors#2863

Draft
joewallwork wants to merge 55 commits into
mainfrom
2862_fortran-norm-example
Draft

Add Fortran test using activity descriptors#2863
joewallwork wants to merge 55 commits into
mainfrom
2862_fortran-norm-example

Conversation

@joewallwork

Copy link
Copy Markdown
Collaborator

Closes #2862
Merges into #2837

Adds the norm example from the Enzyme tutorial https://github.com/EnzymeAD/Enzyme-Tutorial/tree/main/2_norm with variants under ifx and flang.

joewallwork and others added 30 commits May 7, 2026 14:11
Co-authored-by: Valentin Churavy <v.churavy@gmail.com>
@joewallwork joewallwork self-assigned this Jun 8, 2026
@joewallwork joewallwork added the fortran Related to Enzyme's Fortran bindings label Jun 8, 2026
@joewallwork joewallwork linked an issue Jun 8, 2026 that may be closed by this pull request
@joewallwork

Copy link
Copy Markdown
Collaborator Author

Well this is upsetting
https://community.intel.com/t5/Intel-Fortran-Compiler/symbol-E-missing-in-output-of-real-numbers-with-E0-or-ES0-format/m-p/1310862
Under the scientific notation format specifier es0.0, IFX writes 1.-06, whereas every other Fortran compiler I've used would write 1.E-06. For now we can just have different checks because the two variants of the norm example are currently run with two different compilers (see ad68e03). However, eventually we'll need to align this. A few options:

  1. Add custom lit CHECK commands for different compilers (prefer not)
  2. Use #ifdef __INTEL_COMPILER etc (prefer not)
  3. Change what's being printed to avoid the issue, e.g., scale by 1e6 (preferable?)

@vchuravy

Copy link
Copy Markdown
Member

Yeah let's go with 3

@joewallwork

Copy link
Copy Markdown
Collaborator Author

Yeah let's go with 3

Done in f084c97.

@joewallwork

Copy link
Copy Markdown
Collaborator Author

To finish this example, I need to teach Enzyme how to differentiate the Fortran intrinsic sum (i.e. _FortranASumReal4) and also the _FortranAAssign that it sees in the LLVM.

Base automatically changed from 2832_flang-ci to main June 22, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fortran Related to Enzyme's Fortran bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Fortran test using activity descriptors

2 participants