From 9de23a39909657350d9e18ae974b8dcea05c465c Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Mon, 16 Dec 2024 17:45:09 +0200 Subject: [PATCH] Add workaround for ambiguous complex multiplication overloads in HIP --- src/lapack/gpu/larft.cu | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/lapack/gpu/larft.cu b/src/lapack/gpu/larft.cu index aa34d7e9c6..cc855f6fad 100644 --- a/src/lapack/gpu/larft.cu +++ b/src/lapack/gpu/larft.cu @@ -8,6 +8,9 @@ // SPDX-License-Identifier: BSD-3-Clause // +#include +#include + #include #include @@ -46,8 +49,20 @@ __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_ij = hipCmulf(-tau_j, t_ij); + } + else if constexpr (std::is_same_v) { + t_ij = hipCmul(-tau_j, t_ij); + } + else +#endif + { + t_ij = -tau_j * t_ij; + } + } } }