Skip to content

Commit

Permalink
Add workaround for ambiguous complex multiplication overloads in HIP
Browse files Browse the repository at this point in the history
  • Loading branch information
msimberg committed Dec 16, 2024
1 parent d187c66 commit 252f0c4
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/lapack/gpu/larft.cu
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
// SPDX-License-Identifier: BSD-3-Clause
//

#include <complex>
#include <type_traits>

#include <whip.hpp>

#include <dlaf/common/assert.h>
Expand Down Expand Up @@ -46,8 +49,18 @@ __global__ void fix_tau(const unsigned k, const T* tau, unsigned inctau, T* t, u
t_ij = {};
else if (i == j)
t_ij = tau_j;
else
t_ij = -tau_j * t_ij;
else {
#if defined(DLAF_WITH_HIP)
if constexpr (std::is_same_v<T, hipFloatComplex>) {
t_ij = hipCmulf(-tau_j, t_ij);
} else if constexpr (std::is_same_v<T, hipDoubleComplex>) {
t_ij = hipCmul(-tau_j, t_ij);
} else
#endif
{
t_ij = -tau_j * t_ij;
}
}
}
}

Expand Down

0 comments on commit 252f0c4

Please sign in to comment.