Implemented +sycl for slate (#39927)
* Implemented +sycl for slate * style * style * add slate +sycl to ci * slate +sycl: explicitly specify +mpi * comment out slate+sycl+mpi in e4s oneapi stack * removing requirement of intel-oneapi-mpi * Added slate+sycl to e4s oneapi stack * Removing obsolete comment --------- Co-authored-by: eugeneswalker <eugenesunsetwalker@gmail.com>
This commit is contained in:
parent
b3e3604f46
commit
1b75651af6
@ -231,6 +231,7 @@ spack:
|
||||
- cabana +sycl ^kokkos +sycl +openmp cxxstd=17 +tests +examples
|
||||
- kokkos +sycl +openmp cxxstd=17 +tests +examples
|
||||
- kokkos-kernels build_type=Release %oneapi ^kokkos +sycl +openmp cxxstd=17 +tests +examples
|
||||
- slate +sycl
|
||||
# --
|
||||
# - ginkgo +oneapi # InstallError: Ginkgo's oneAPI backend requires theDPC++ compiler as main CXX compiler.
|
||||
# - hpctoolkit +level_zero # intel-tbb: icpx: error: unknown argument: '-flifetime-dse=1'
|
||||
|
@ -46,11 +46,14 @@ class Blaspp(CMakePackage, CudaPackage, ROCmPackage):
|
||||
|
||||
variant("openmp", default=True, description="Use OpenMP internally.")
|
||||
variant("shared", default=True, description="Build shared libraries")
|
||||
variant("sycl", default=False, description="Build support for the SYCL backend")
|
||||
|
||||
depends_on("cmake@3.15.0:", type="build")
|
||||
depends_on("blas")
|
||||
depends_on("llvm-openmp", when="%apple-clang +openmp")
|
||||
depends_on("rocblas", when="+rocm")
|
||||
depends_on("intel-oneapi-mkl", when="+sycl")
|
||||
depends_on("intel-oneapi-mkl threads=openmp", when="+sycl")
|
||||
|
||||
# only supported with clingo solver: virtual dependency preferences
|
||||
# depends_on('openblas threads=openmp', when='+openmp ^openblas')
|
||||
@ -63,7 +66,21 @@ class Blaspp(CMakePackage, CudaPackage, ROCmPackage):
|
||||
conflicts(
|
||||
"+rocm", when="@:2020.10.02", msg="ROCm support requires BLAS++ 2021.04.00 or greater"
|
||||
)
|
||||
conflicts("+rocm", when="+cuda", msg="BLAS++ can only support one GPU backend at a time")
|
||||
backend_msg = "BLAS++ supports only one GPU backend at a time"
|
||||
conflicts("+rocm", when="+cuda", msg=backend_msg)
|
||||
conflicts("+rocm", when="+sycl", msg=backend_msg)
|
||||
conflicts("+cuda", when="+sycl", msg=backend_msg)
|
||||
conflicts("+sycl", when="@:2023.06.00", msg="SYCL support requires BLAS++ version 2023.08.25")
|
||||
|
||||
# TODO: +sycl requires use of the intel-oneapi compiler, but we cannot express that directly.
|
||||
# For now, add conflicts for other compilers instead.
|
||||
for __compiler in spack.compilers.supported_compilers():
|
||||
if __compiler != "oneapi":
|
||||
conflicts(
|
||||
"%{0}".format(__compiler),
|
||||
when="+sycl",
|
||||
msg="blaspp+sycl must be compiled with %oneapi",
|
||||
)
|
||||
|
||||
def cmake_args(self):
|
||||
spec = self.spec
|
||||
@ -74,6 +91,8 @@ def cmake_args(self):
|
||||
backend = "cuda"
|
||||
if "+rocm" in spec:
|
||||
backend = "hip"
|
||||
if "+sycl" in spec:
|
||||
backend = "sycl"
|
||||
backend_config = "-Dgpu_backend=%s" % backend
|
||||
|
||||
args = [
|
||||
|
@ -59,6 +59,7 @@ class Lapackpp(CMakePackage, CudaPackage, ROCmPackage):
|
||||
)
|
||||
|
||||
variant("shared", default=True, description="Build shared library")
|
||||
variant("sycl", default=False, description="Build support for the SYCL backend")
|
||||
|
||||
# Match each LAPACK++ version to a specific BLAS++ version
|
||||
for lpp_ver, bpp_ver in _versions:
|
||||
@ -66,6 +67,8 @@ class Lapackpp(CMakePackage, CudaPackage, ROCmPackage):
|
||||
|
||||
depends_on("blaspp ~cuda", when="~cuda")
|
||||
depends_on("blaspp +cuda", when="+cuda")
|
||||
depends_on("blaspp ~sycl", when="~sycl")
|
||||
depends_on("blaspp +sycl", when="+sycl")
|
||||
depends_on("blaspp ~rocm", when="~rocm")
|
||||
for val in ROCmPackage.amdgpu_targets:
|
||||
depends_on("blaspp +rocm amdgpu_target=%s" % val, when="amdgpu_target=%s" % val)
|
||||
@ -74,8 +77,23 @@ class Lapackpp(CMakePackage, CudaPackage, ROCmPackage):
|
||||
depends_on("lapack")
|
||||
depends_on("rocblas", when="+rocm")
|
||||
depends_on("rocsolver", when="+rocm")
|
||||
depends_on("intel-oneapi-mkl threads=openmp", when="+sycl")
|
||||
|
||||
conflicts("+rocm", when="+cuda", msg="LAPACK++ can only support one GPU backend at a time")
|
||||
backend_msg = "LAPACK++ supports only one GPU backend at a time"
|
||||
conflicts("+rocm", when="+cuda", msg=backend_msg)
|
||||
conflicts("+rocm", when="+sycl", msg=backend_msg)
|
||||
conflicts("+cuda", when="+sycl", msg=backend_msg)
|
||||
conflicts("+sycl", when="@:2023.06.00", msg="+sycl requires LAPACK++ version 2023.08.25")
|
||||
|
||||
# TODO: +sycl requires use of the intel-oneapi compiler, but we cannot express that directly.
|
||||
# For now, add conflicts for other compilers instead.
|
||||
for __compiler in spack.compilers.supported_compilers():
|
||||
if __compiler != "oneapi":
|
||||
conflicts(
|
||||
"%{0}".format(__compiler),
|
||||
when="+sycl",
|
||||
msg="lapackpp+sycl must be compiled with %oneapi",
|
||||
)
|
||||
|
||||
def cmake_args(self):
|
||||
spec = self.spec
|
||||
@ -86,6 +104,8 @@ def cmake_args(self):
|
||||
backend = "cuda"
|
||||
if "+rocm" in spec:
|
||||
backend = "hip"
|
||||
if "+sycl" in spec:
|
||||
backend = "sycl"
|
||||
|
||||
args = [
|
||||
"-DBUILD_SHARED_LIBS=%s" % ("+shared" in spec),
|
||||
|
@ -51,17 +51,23 @@ class Slate(CMakePackage, CudaPackage, ROCmPackage):
|
||||
)
|
||||
variant("openmp", default=True, description="Build with OpenMP support.")
|
||||
variant("shared", default=True, description="Build shared library")
|
||||
variant("sycl", default=False, description="Build with SYCL backend")
|
||||
|
||||
# The runtime dependency on cmake is needed by the stand-alone tests (spack test).
|
||||
depends_on("cmake", type="run")
|
||||
|
||||
depends_on("mpi", when="+mpi")
|
||||
depends_on("intel-oneapi-mkl threads=openmp", when="+sycl")
|
||||
depends_on("blas")
|
||||
depends_on("blaspp ~cuda", when="~cuda")
|
||||
depends_on("blaspp +cuda", when="+cuda")
|
||||
depends_on("blaspp ~sycl", when="~sycl")
|
||||
depends_on("blaspp +sycl", when="+sycl")
|
||||
depends_on("blaspp ~rocm", when="~rocm")
|
||||
depends_on("lapackpp ~cuda", when="~cuda")
|
||||
depends_on("lapackpp +cuda", when="+cuda")
|
||||
depends_on("lapackpp ~sycl", when="~sycl")
|
||||
depends_on("lapackpp +sycl", when="+sycl")
|
||||
depends_on("lapackpp ~rocm", when="~rocm")
|
||||
for val in CudaPackage.cuda_arch_values:
|
||||
depends_on("blaspp +cuda cuda_arch=%s" % val, when="cuda_arch=%s" % val)
|
||||
@ -78,6 +84,16 @@ class Slate(CMakePackage, CudaPackage, ROCmPackage):
|
||||
depends_on("scalapack", type="test")
|
||||
depends_on("hipify-clang", when="@:2021.05.02 +rocm ^hip@5:")
|
||||
|
||||
# TODO: +sycl requires use of the intel-oneapi compiler, but we cannot express that directly.
|
||||
# For now, add conflicts for other compilers instead.
|
||||
for __compiler in spack.compilers.supported_compilers():
|
||||
if __compiler != "oneapi":
|
||||
conflicts(
|
||||
"%{0}".format(__compiler),
|
||||
when="+sycl",
|
||||
msg="slate+sycl must be compiled with %oneapi",
|
||||
)
|
||||
|
||||
cpp_17_msg = "Requires C++17 compiler support"
|
||||
conflicts("%gcc@:5", msg=cpp_17_msg)
|
||||
conflicts("%xl", msg=cpp_17_msg)
|
||||
@ -86,7 +102,11 @@ class Slate(CMakePackage, CudaPackage, ROCmPackage):
|
||||
conflicts(
|
||||
"+rocm", when="@:2020.10.00", msg="ROCm support requires SLATE 2021.05.01 or greater"
|
||||
)
|
||||
conflicts("+rocm", when="+cuda", msg="SLATE only supports one GPU backend at a time")
|
||||
backend_msg = "SLATE supports only one GPU backend at a time"
|
||||
conflicts("+rocm", when="+cuda", msg=backend_msg)
|
||||
conflicts("+rocm", when="+sycl", msg=backend_msg)
|
||||
conflicts("+cuda", when="+sycl", msg=backend_msg)
|
||||
conflicts("+sycl", when="@:2022.07.00", msg="SYCL support requires SLATE version 2023.08.25")
|
||||
|
||||
def cmake_args(self):
|
||||
spec = self.spec
|
||||
@ -97,6 +117,8 @@ def cmake_args(self):
|
||||
backend = "cuda"
|
||||
if "+rocm" in spec:
|
||||
backend = "hip"
|
||||
if "+sycl" in spec:
|
||||
backend = "sycl"
|
||||
backend_config = "-Dgpu_backend=%s" % backend
|
||||
|
||||
config = [
|
||||
|
Loading…
Reference in New Issue
Block a user