From 5b18974452a66b59ceee23fab93fcd78dc6b87fd Mon Sep 17 00:00:00 2001 From: Jose Gracia Date: Tue, 24 Sep 2024 06:30:50 -0500 Subject: [PATCH] Fix build failure when kokkos +rocm is enabled. (#44459) --- var/spack/repos/builtin/packages/kokkos/package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/var/spack/repos/builtin/packages/kokkos/package.py b/var/spack/repos/builtin/packages/kokkos/package.py index e55746b7bf..3502d7a4cd 100644 --- a/var/spack/repos/builtin/packages/kokkos/package.py +++ b/var/spack/repos/builtin/packages/kokkos/package.py @@ -197,6 +197,7 @@ class Kokkos(CMakePackage, CudaPackage, ROCmPackage): variant(dev, default=dflt, description=desc) conflicts("+cuda", when="+rocm", msg="CUDA and ROCm are not compatible in Kokkos.") depends_on("intel-oneapi-dpl", when="+sycl") + depends_on("rocthrust", when="@4.3: +rocm") for opt, (dflt, desc) in options_variants.items(): variant(opt, default=dflt, description=desc, when=("+cuda" if "cuda" in opt else None)) @@ -349,6 +350,7 @@ def cmake_args(self): if "+rocm" in self.spec: options.append(self.define("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc)) + options.append(self.define("Kokkos_ENABLE_ROCTHRUST", True)) elif "+wrapper" in self.spec: options.append( self.define("CMAKE_CXX_COMPILER", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx)