-
Notifications
You must be signed in to change notification settings - Fork 408
Fix the internal compiler error with gcc 12/13 and CUDA 12.4/12.5 #2282
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
base: main
Are you sure you want to change the base?
Conversation
|
Is there any interest to get this merged? I need to patch newer releases with Grace Hopper support. |
|
I am curious: Does it work if, instead of removing |
|
I can try it next week. |
|
Thank you. If that does not work, let me know because I have another suggestion in mind. |
|
@garrison I changed the first two ones and now I get |
|
|
||
| const uint_t mask_u = ~MASKS[x_max + 1]; | ||
| const uint_t mask_l = MASKS[x_max]; | ||
| uint_t mask_u = ~MASKS[x_max + 1]; | ||
| uint_t mask_l = MASKS[x_max]; | ||
| auto lambda = [&](const int_t i, double &val_re, double &val_im) -> void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to see what happens if these three lines look like
const uint_t mask_u = ~MASKS[x_max + 1];
const uint_t mask_l = MASKS[x_max];
auto lambda = [&, mask_u, mask_l](const int_t i, double &val_re, double &val_im) -> void {
i.e., the only change from the original is to add , mask_u, mask_l to the capture so that those are captured by value instead of reference. And likewise for the other places with the proposed change.
|
|
||
| const size_t N = qubits.size(); | ||
| size_t N = qubits.size(); | ||
| auto func = [&](const areg_t<2> &inds, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here would be
const size_t N = qubits.size();
auto func = [&, N](const areg_t<2> &inds,
@diehlpk, thank you for trying that. I added a new suggestion above. |
Summary
Compiling qiskit-aer with CUDA support and gcc 12/13 resulted in some internal compiler error, see #2227.
The error was resolved by removing the
constexpression in from of the lambda functions. The issue is that the aboveconstdeclared variables are passed to the lambda function using&as the default capture of the lambda function. Passing a constant value by reference to a lambda function causes issues by gcc 12/13.Details and comments
Removing the
constexpression allows the code to compile with gcc 12/13 using CUDA 12.4/12.5. I have not yet checked if the issue us specific to Grace Grace and Grace Hopper which is ARM.