summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/dihydrogen/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/dihydrogen/package.py')
-rw-r--r--var/spack/repos/builtin/packages/dihydrogen/package.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/dihydrogen/package.py b/var/spack/repos/builtin/packages/dihydrogen/package.py
index 40ffd50d2d..082ea55559 100644
--- a/var/spack/repos/builtin/packages/dihydrogen/package.py
+++ b/var/spack/repos/builtin/packages/dihydrogen/package.py
@@ -83,9 +83,9 @@ class Dihydrogen(CMakePackage, CudaPackage, ROCmPackage):
for val in ROCmPackage.amdgpu_targets:
depends_on("aluminum amdgpu_target=%s" % val, when="amdgpu_target=%s" % val)
- for when in ["+cuda", "+distconv"]:
- depends_on("cuda", when=when)
- depends_on("cudnn", when=when)
+ depends_on("roctracer-dev", when="+rocm +distconv")
+
+ depends_on("cudnn", when="+cuda +distconv")
depends_on("cub", when="^cuda@:10")
# Note that #1712 forces us to enumerate the different blas variants
@@ -108,8 +108,8 @@ class Dihydrogen(CMakePackage, CudaPackage, ROCmPackage):
depends_on("cray-libsci", when="blas=libsci")
depends_on("cray-libsci +openmp", when="blas=libsci +openmp_blas")
- # Distconv builds require cuda
- conflicts("~cuda", when="+distconv")
+ # Distconv builds require cuda or rocm
+ conflicts("+distconv", when="~cuda ~rocm")
conflicts("+distconv", when="+half")
conflicts("+rocm", when="+half")
@@ -120,6 +120,8 @@ class Dihydrogen(CMakePackage, CudaPackage, ROCmPackage):
depends_on("ninja", type="build")
depends_on("cmake@3.17.0:", type="build")
+ depends_on("spdlog", when="@:0.1,0.2:")
+
depends_on("llvm-openmp", when="%apple-clang +openmp")
# TODO: Debug linker errors when NVSHMEM is built with UCX
@@ -155,10 +157,14 @@ class Dihydrogen(CMakePackage, CudaPackage, ROCmPackage):
"-DH2_ENABLE_DISTCONV_LEGACY=%s" % ("+distconv" in spec),
"-DH2_ENABLE_OPENMP=%s" % ("+openmp" in spec),
"-DH2_ENABLE_FP16=%s" % ("+half" in spec),
- "-DH2_ENABLE_HIP_ROCM=%s" % ("+rocm" in spec),
"-DH2_DEVELOPER_BUILD=%s" % ("+developer" in spec),
]
+ if spec.version < Version("0.3"):
+ args.append("-DH2_ENABLE_HIP_ROCM=%s" % ("+rocm" in spec))
+ else:
+ args.append("-DH2_ENABLE_ROCM=%s" % ("+rocm" in spec))
+
if not spec.satisfies("^cmake@3.23.0"):
# There is a bug with using Ninja generator in this version
# of CMake
@@ -181,7 +187,7 @@ class Dihydrogen(CMakePackage, CudaPackage, ROCmPackage):
if spec.satisfies("%cce") and spec.satisfies("^cuda+allow-unsupported-compilers"):
args.append("-DCMAKE_CUDA_FLAGS=-allow-unsupported-compiler")
- if "+cuda" in spec or "+distconv" in spec:
+ if "+cuda" in spec:
args.append("-DcuDNN_DIR={0}".format(spec["cudnn"].prefix))
if spec.satisfies("^cuda@:10"):
@@ -209,6 +215,12 @@ class Dihydrogen(CMakePackage, CudaPackage, ROCmPackage):
"-DHIP_CXX_COMPILER={0}".format(self.spec["hip"].hipcc),
]
)
+ if "platform=cray" in spec:
+ args.extend(
+ [
+ "-DMPI_ASSUME_NO_BUILTIN_MPI=ON",
+ ]
+ )
archs = self.spec.variants["amdgpu_target"].value
if archs != "none":
arch_str = ",".join(archs)