summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMikael Simberg <mikael.simberg@iki.fi>2024-03-11 10:44:00 +0100
committerGitHub <noreply@github.com>2024-03-11 10:44:00 +0100
commit8ecae17c464cc081339f8625328aa7720b3326f9 (patch)
tree5329b3e6fae7140f156c42a386b34e33152ec729 /var
parent1e47ccb83a3e0b394560f39538cde6563edbaca3 (diff)
downloadspack-8ecae17c464cc081339f8625328aa7720b3326f9.tar.gz
spack-8ecae17c464cc081339f8625328aa7720b3326f9.tar.bz2
spack-8ecae17c464cc081339f8625328aa7720b3326f9.tar.xz
spack-8ecae17c464cc081339f8625328aa7720b3326f9.zip
dla-future: Add patch for compilation with newer ROCm versions (#42348)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/dla-future/hip_complex_operator_overloads.patch23
-rw-r--r--var/spack/repos/builtin/packages/dla-future/package.py2
2 files changed, 25 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/dla-future/hip_complex_operator_overloads.patch b/var/spack/repos/builtin/packages/dla-future/hip_complex_operator_overloads.patch
new file mode 100644
index 0000000000..a42f284f41
--- /dev/null
+++ b/var/spack/repos/builtin/packages/dla-future/hip_complex_operator_overloads.patch
@@ -0,0 +1,23 @@
+diff --git a/src/lapack/gpu/add.cu b/src/lapack/gpu/add.cu
+index a55110c2..5d839540 100644
+--- a/src/lapack/gpu/add.cu
++++ b/src/lapack/gpu/add.cu
+@@ -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;
diff --git a/var/spack/repos/builtin/packages/dla-future/package.py b/var/spack/repos/builtin/packages/dla-future/package.py
index 7d1f5b1002..ef931e9927 100644
--- a/var/spack/repos/builtin/packages/dla-future/package.py
+++ b/var/spack/repos/builtin/packages/dla-future/package.py
@@ -129,6 +129,8 @@ class DlaFuture(CMakePackage, CudaPackage, ROCmPackage):
sha256="7f382c872d89f22da1ad499e85ffe9881cc7404c8465e42877a210a09382e2ea",
when="@:0.3 %gcc@13:",
)
+ # https://github.com/spack/spack/issues/41511
+ patch("hip_complex_operator_overloads.patch", when="+rocm")
def cmake_args(self):
spec = self.spec