Skip to content
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

Building with strict floating point operations for testing purposes #622

Open
sbryngelson opened this issue Sep 11, 2024 · 1 comment
Open
Labels
continuous-integration Continuous integration (CI) enhancement New feature or request

Comments

@sbryngelson
Copy link
Member

sbryngelson commented Sep 11, 2024

A --strict build flag that passes compile options that enforce floating point consistency. This would be used for generating goldenfiles and on the runners.

These need to be documented for the relevant compilers. GCC, CCE, Intel, and NVHPC.

In practice, the compilers that seem to need many flags may actually not need so many, since one flag could automatically trigger the others.

The default is -Knoieee and the compiler does not provide special compilation semantics.

-K<flag>

ieee 
Perform floating-point operations in strict conformance with the IEEE 754 standard.
Some optimizations are disabled, and on some systems a more accurate math library is
linked if -Kieee is used during the link step.

and

[no]fprelaxed[=option] 
Perform certain floating point intrinsic functions using
relaxed precision.
-fp-strict
-ffloat-store

and from here https://docs.oracle.com/cd/E19059-01/stud.10/819-0492/3_options.html#75972 we have (update: this one doesn't work)

-fsimple=0

and from here https://gcc.gnu.org/wiki/FloatingPointMath

-frounding-math -fsignaling-nans

would have to add all these to be sure they all work on an x86 CPU for typical GNU compilers.

-h flex_mp=intolerant

and

-hp0 -hfp0

and

-h vector0

and

-fp0
@sbryngelson sbryngelson added enhancement New feature or request continuous-integration Continuous integration (CI) labels Sep 11, 2024
@sbryngelson sbryngelson linked a pull request Sep 21, 2024 that will close this issue
9 tasks
@sbryngelson
Copy link
Member Author

@okBrian https://www.godbolt.org/ I've been playing with this and have not had much success... it suggests visibly different assembly for the two compilers (though perhaps consistent across compiler versions)... even when using special compiler flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
continuous-integration Continuous integration (CI) enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

1 participant