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 the internal compiler error with gcc 12/13 and CUDA 12.4/12.5 #2282

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/simulators/density_matrix/densitymatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,8 @@ DensityMatrix<data_t>::expval_pauli(const reg_t &qubits,
auto phase = std::complex<data_t>(initial_phase);
QV::add_y_phase(num_y, phase);

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 {
(void)val_im; // unused
auto idx_vec = ((i << 1) & mask_u) | (i & mask_l);
Expand Down
8 changes: 4 additions & 4 deletions src/simulators/statevector/qubitvector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2324,8 +2324,8 @@ double QubitVector<data_t>::expval_pauli(const reg_t &qubits,
return std::real(apply_reduction_lambda(std::move(lambda)));
}

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 {
(void)val_im; // unused
int_t idxs[2];
Expand Down Expand Up @@ -2415,8 +2415,8 @@ void QubitVector<data_t>::apply_pauli(const reg_t &qubits,
return;
}

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) -> void {
int_t idxs[2];
idxs[0] = ((i << 1) & mask_u) | (i & mask_l);
Expand Down
2 changes: 1 addition & 1 deletion src/simulators/statevector/transformer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void Transformer<Container, data_t>::apply_diagonal_matrix(
return;
}

const size_t N = qubits.size();
size_t N = qubits.size();
auto func = [&](const areg_t<2> &inds,
const cvector_t<data_t> &_diag) -> void {
for (int_t i = 0; i < 2; ++i) {
Expand Down