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 25, 2024
1 parent 0208a04 commit 0ece43f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lapack/gpu/add.cu
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ __device__ inline void addAlpha(const T& alpha, const T& a, T& b) {
b = b + alpha * a;
}

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);
}

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

0 comments on commit 0ece43f

Please sign in to comment.