Introduce offload variant for llvm >= 19. (#45865)
This commit is contained in:
parent
9d8f94a7c8
commit
b1af32cb60
@ -165,8 +165,12 @@ class Llvm(CMakePackage, CudaPackage, LlvmDetection, CompilerPackage):
|
|||||||
"or as a project (with the compiler in use)",
|
"or as a project (with the compiler in use)",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
variant("offload", default=True, when="@19:", description="Build the Offload subproject")
|
||||||
|
conflicts("+offload", when="~clang")
|
||||||
|
|
||||||
variant("libomptarget", default=True, description="Build the OpenMP offloading library")
|
variant("libomptarget", default=True, description="Build the OpenMP offloading library")
|
||||||
conflicts("+libomptarget", when="~clang")
|
conflicts("+libomptarget", when="~clang")
|
||||||
|
conflicts("+libomptarget", when="~offload @19:")
|
||||||
for _p in ["darwin", "windows"]:
|
for _p in ["darwin", "windows"]:
|
||||||
conflicts("+libomptarget", when="platform={0}".format(_p))
|
conflicts("+libomptarget", when="platform={0}".format(_p))
|
||||||
del _p
|
del _p
|
||||||
@ -912,6 +916,9 @@ def cmake_args(self):
|
|||||||
elif "openmp=project" in spec:
|
elif "openmp=project" in spec:
|
||||||
projects.append("openmp")
|
projects.append("openmp")
|
||||||
|
|
||||||
|
if "+offload" in spec:
|
||||||
|
runtimes.append("offload")
|
||||||
|
|
||||||
if "+libomptarget" in spec:
|
if "+libomptarget" in spec:
|
||||||
cmake_args.append(define("OPENMP_ENABLE_LIBOMPTARGET", True))
|
cmake_args.append(define("OPENMP_ENABLE_LIBOMPTARGET", True))
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user