rocm conflicts with compilers that do not support rocm

This commit is contained in:
Gregory Becker
2024-04-12 11:31:08 -07:00
parent fb4e1cad45
commit 0b1f74bd04
2 changed files with 4 additions and 5 deletions

View File

@@ -139,11 +139,6 @@ def initconfig_compiler_entries(self):
"endif()\n",
]
# We defined hipcc as top-level compiler for packages when +rocm.
# This avoid problems coming from rocm flags being applied to another compiler.
if "+rocm" in spec:
entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc))
flags = spec.compiler_flags
# use global spack compiler flags

View File

@@ -145,7 +145,11 @@ class ROCmPackage(PackageBase):
depends_on("hip +rocm", when="+rocm")
# need amd gpu type for rocm builds
compilers_supporting_rocm = ("cce", "rocmcc")
conflicts("amdgpu_target=none", when="+rocm")
for compiler in spack.compilers.supported_compilers():
if compiler not in compilers_supporting_rocm:
conflicts(f"%{compiler}", when="+rocm")
# https://github.com/ROCm-Developer-Tools/HIP/blob/master/bin/hipcc
# It seems that hip-clang does not (yet?) accept this flag, in which case