fix cmake cache package handling for hip workaround

This commit is contained in:
Tom Scogland 2022-09-26 13:52:00 -07:00 committed by Tom Scogland
parent 90b86a2266
commit d0136899a2
3 changed files with 14 additions and 4 deletions

View File

@ -16,6 +16,16 @@ def hip_repair_options(options, spec):
)
def hip_repair_cache(options, spec):
# there is only one dir like this, but the version component is unknown
options.append(
cmake_cache_path(
"HIP_CLANG_INCLUDE_PATH",
glob.glob("{}/lib/clang/*/include".format(spec["llvm-amdgpu"].prefix))[0],
)
)
class Camp(CMakePackage, CudaPackage, ROCmPackage):
"""
Compiler agnostic metaprogramming library providing concepts,

View File

@ -6,7 +6,7 @@
import socket
from spack.package import *
from spack.pkg.builtin.camp import hip_repair_options
from spack.pkg.builtin.camp import hip_repair_cache
class Raja(CachedCMakePackage, CudaPackage, ROCmPackage):
@ -125,7 +125,7 @@ def initconfig_hardware_entries(self):
if "+rocm" in spec:
entries.append(cmake_cache_option("ENABLE_HIP", True))
entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix)))
hip_repair_options(entries, spec)
hip_repair_cache(entries, spec)
archs = self.spec.variants["amdgpu_target"].value
if archs != "none":
arch_str = ",".join(archs)

View File

@ -9,7 +9,7 @@
import llnl.util.tty as tty
from spack.package import *
from spack.pkg.builtin.camp import hip_repair_options
from spack.pkg.builtin.camp import hip_repair_cache
class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage):
@ -188,7 +188,7 @@ def initconfig_hardware_entries(self):
if "+rocm" in spec:
entries.append(cmake_cache_option("ENABLE_HIP", True))
entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix)))
hip_repair_options(entries, spec)
hip_repair_cache(entries, spec)
archs = self.spec.variants["amdgpu_target"].value
if archs != "none":
arch_str = ",".join(archs)