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

GPU: Compile with -ffast-math #12807

Merged
merged 2 commits into from
Mar 6, 2024
Merged

Conversation

davidrohr
Copy link
Collaborator

We compile the GPU code with -ffast-math anyway, so no reason not to do the same for CPU by default in non-debug builds

Copy link
Contributor

github-actions bot commented Mar 4, 2024

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2023-pbpb-apass
async-2023-pp-apass1
async-2022-pp-apass6
async-2022-pp-apass4
async-mc
async-data

@davidrohr
Copy link
Collaborator Author

@ktf @shahor02 : Any objections?
This is only for the GPU tracking code. The default GPU flags use fast-math, so if we consider it safe there, we can do the same for the CPU. Should even make the results more similar in some sense.

@ktf
Copy link
Member

ktf commented Mar 5, 2024

There is an error in the Common/DCAFitter/test/testDCAFitterN.cxx is it related?

@ktf
Copy link
Member

ktf commented Mar 5, 2024

Apart from that, no objections.

@davidrohr davidrohr force-pushed the dev_pull_request2 branch from 024be1e to 7975083 Compare March 6, 2024 15:19
@davidrohr davidrohr requested a review from shahor02 as a code owner March 6, 2024 15:19
@davidrohr
Copy link
Collaborator Author

The problem with the DCAFitter was:
Once any library is linked with -ffast-math or denormals-are-zero or -flush-to-zero flags, GCC puts in a static function that sets denormals to zero. Once one links to that, all denormals are treated as zero.
The match constants Almost0 constant was subnormal, and was thus treated as 0, which led to several problems once one links to any library with fast-math.
Fix by adjusting the constant to the smallest non-denormal float value.

@davidrohr davidrohr force-pushed the dev_pull_request2 branch from 7975083 to abba31e Compare March 6, 2024 18:07
@davidrohr davidrohr requested a review from a team as a code owner March 6, 2024 18:07
@davidrohr davidrohr merged commit f118ce8 into AliceO2Group:dev Mar 6, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants