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

Fix performance with C++17 #1611

Merged
merged 2 commits into from
Mar 23, 2021
Merged

Conversation

lukasm91
Copy link
Contributor

@lukasm91 lukasm91 commented Mar 11, 2021

With C++17, as_const was added into the standard and if as_const is not called qualified, we end up with std::as_const (which is also a better match) in most cases because there is some std inside one of the template arguments.

By qualifying as_const, performance is fixed.

For GTBench, performance is identical with -std=c++14 and -std=c++17 now.

@lukasm91 lukasm91 requested a review from anstaf March 11, 2021 13:44
@lukasm91
Copy link
Contributor Author

I propose we should also port this back to release_v2.0 since it is has major performance impact on some kernels.

@havogt
Copy link
Contributor

havogt commented Mar 22, 2021

launch jenkins

@havogt
Copy link
Contributor

havogt commented Mar 23, 2021

launch jenkins

@havogt
Copy link
Contributor

havogt commented Mar 23, 2021

tests on daint are ok

@havogt havogt merged commit b559f8b into GridTools:master Mar 23, 2021
havogt pushed a commit to havogt/gridtools that referenced this pull request Mar 23, 2021
With C++17, `as_const` was added into the standard and if `as_const` is not called qualified, we end up with `std::as_const` (which is also a better match) in most cases because there is some `std` inside one of the template arguments.

By qualifying `as_const`, performance is fixed.

For GTBench, performance is identical with `-std=c++14` and `-std=c++17` now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants