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

Enable CTAD by default for GCC 9 #222

Closed
mhoemmen opened this issue Dec 16, 2022 · 12 comments
Closed

Enable CTAD by default for GCC 9 #222

mhoemmen opened this issue Dec 16, 2022 · 12 comments

Comments

@mhoemmen
Copy link
Contributor

The implementation currently disables CTAD by default for GCC < 11.

https://github.com/youyu3/mdspan/blob/d4ba2621d097d31c85399f16b2976b3643bce08e/include/experimental/__p0009_bits/config.hpp#L220

However, it is known to work for GCC 9.2.0. @youyu3 confirmed that

  • CTAD works with both nvcc + GCC 9.2.0, and GCC 9.2.0 alone; and
  • CTAD does not work with GCC 10.2.0.

Thus, we should consider enabling CTAD by default for GCC 9, and only disabling it by default for GCC < 9 or GCC 10.

@youyu3
Copy link
Contributor

youyu3 commented Dec 16, 2022

@crtrott
Copy link
Member

crtrott commented Dec 19, 2022

Did you test all other GCC 9.x compilers? I.e. do they work all?

@youyu3
Copy link
Contributor

youyu3 commented Jan 6, 2023

My machine only has GCC 9.1, 9.2 and 9.3. It worked for all of them. I'll need to install GCC 9.4 and 9.5 to test them.

@adah1972
Copy link
Contributor

adah1972 commented Feb 9, 2023

I do not know what made Bryce @brycelelbach say "GCC 10's CTAD seems sufficiently broken to prevent its use" in commit 972a4bc, but currently CTAD seems to work well in all C++17-supporting GCC versions. The following command works well:

g++ -std=c++17 -D_MDSPAN_USE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION \
    -Iinclude examples/godbolt_starter/godbolt_starter.cpp

I tested with the following GCC versions:

  • 7.50
  • 8.4.0
  • 9.4.0
  • 10.3.0
  • 10.4.0
  • 11.3.0
  • 12.2.0

The comment in commit 2141453 mentioned a GCC bug 100983, which was fixed only in GCC 12. However, the current mdspan code does not seem to rely on the absence of this bug.

So I would suggest removing the (defined(_MDSPAN_COMPILER_CLANG) || !defined(__GNUC__) || __GNUC__ >= 11) conditionals, unless we have new reasons to believe otherwise.

@brycelelbach
Copy link
Contributor

brycelelbach commented Feb 9, 2023 via email

@adah1972
Copy link
Contributor

@brycelelbach

Hi Bryce, I believe there was a reason, but I do not know (as the current example does not even work with clang at commit 2141453). The key question is whether the reason still holds.

I believe not.

Do you think I should submit a patch to remove all the GCC conditionals?

@brycelelbach
Copy link
Contributor

brycelelbach commented Feb 11, 2023 via email

@adah1972
Copy link
Contributor

PR submitted. Please review.

@brycelelbach

@brycelelbach
Copy link
Contributor

brycelelbach commented Feb 12, 2023 via email

@adah1972
Copy link
Contributor

@crtrott Hi Chris, would you please take a look? It is a simple change.

@mhoemmen
Copy link
Contributor Author

@adah1972 FYI, his name is Christian, not Chris. It's Sunday and he just finished a week-long WG21 meeting (in fact, we all just did), so he might not get to this immediately. Thank you for your contribution!

@adah1972
Copy link
Contributor

Ha, looking up the dictionary, I've found that Chris is not the shortened form of Christian. Sorry for my mistake.

No hurry.

@crtrott crtrott closed this as completed Feb 16, 2023
mhoemmen added a commit to mhoemmen/mdspan that referenced this issue Jul 26, 2023
…recursion

Fix infinite recursion crash in `gemm` cross-test
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

No branches or pull requests

5 participants