fix cmake cache package handling for hip workaround
This commit is contained in:
parent
90b86a2266
commit
d0136899a2
@ -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):
|
class Camp(CMakePackage, CudaPackage, ROCmPackage):
|
||||||
"""
|
"""
|
||||||
Compiler agnostic metaprogramming library providing concepts,
|
Compiler agnostic metaprogramming library providing concepts,
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
import socket
|
import socket
|
||||||
|
|
||||||
from spack.package import *
|
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):
|
class Raja(CachedCMakePackage, CudaPackage, ROCmPackage):
|
||||||
@ -125,7 +125,7 @@ def initconfig_hardware_entries(self):
|
|||||||
if "+rocm" in spec:
|
if "+rocm" in spec:
|
||||||
entries.append(cmake_cache_option("ENABLE_HIP", True))
|
entries.append(cmake_cache_option("ENABLE_HIP", True))
|
||||||
entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix)))
|
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
|
archs = self.spec.variants["amdgpu_target"].value
|
||||||
if archs != "none":
|
if archs != "none":
|
||||||
arch_str = ",".join(archs)
|
arch_str = ",".join(archs)
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
import llnl.util.tty as tty
|
import llnl.util.tty as tty
|
||||||
|
|
||||||
from spack.package import *
|
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):
|
class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage):
|
||||||
@ -188,7 +188,7 @@ def initconfig_hardware_entries(self):
|
|||||||
if "+rocm" in spec:
|
if "+rocm" in spec:
|
||||||
entries.append(cmake_cache_option("ENABLE_HIP", True))
|
entries.append(cmake_cache_option("ENABLE_HIP", True))
|
||||||
entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix)))
|
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
|
archs = self.spec.variants["amdgpu_target"].value
|
||||||
if archs != "none":
|
if archs != "none":
|
||||||
arch_str = ",".join(archs)
|
arch_str = ",".join(archs)
|
||||||
|
Loading…
Reference in New Issue
Block a user