Skip to content

Commit

Permalink
Patch addAlpha definitions to work around buggy HIP complex operator …
Browse files Browse the repository at this point in the history
…overloads
  • Loading branch information
msimberg committed Sep 26, 2024
1 parent 0208a04 commit 52f7ee2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lapack/gpu/add.cu
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ __device__ inline void addAlpha(const T& alpha, const T& a, T& b) {
b = b + alpha * a;
}

#ifdef DLAF_WITH_HIP
template <>
__device__ inline void addAlpha<hipFloatComplex>(const hipFloatComplex& alpha, const hipFloatComplex& a,
hipFloatComplex& b) {
b = b + hipCmulf(alpha, a);
}

template <>
__device__ inline void addAlpha<hipDoubleComplex>(const hipDoubleComplex& alpha,
const hipDoubleComplex& a, hipDoubleComplex& b) {
b = b + hipCmul(alpha, a);
}
#endif

template <class T>
__device__ inline void sum(const T& /*alpha*/, const T& a, T& b) {
b = b + a;
Expand Down

0 comments on commit 52f7ee2

Please sign in to comment.