diff options
author | G-Ragghianti <33492707+G-Ragghianti@users.noreply.github.com> | 2023-10-02 10:35:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-02 07:35:00 -0700 |
commit | 1b75651af6e84cd8ad41bbd0257ab16e09389eec (patch) | |
tree | 597452fc272fbb370d7eee44cef45ac8af7008b5 | |
parent | b3e3604f461824e90b222babc0fd8c343c316833 (diff) | |
download | spack-1b75651af6e84cd8ad41bbd0257ab16e09389eec.tar.gz spack-1b75651af6e84cd8ad41bbd0257ab16e09389eec.tar.bz2 spack-1b75651af6e84cd8ad41bbd0257ab16e09389eec.tar.xz spack-1b75651af6e84cd8ad41bbd0257ab16e09389eec.zip |
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>
4 files changed, 66 insertions, 4 deletions
diff --git a/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml index 2c97d4e4be..798ba974ce 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml @@ -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' diff --git a/var/spack/repos/builtin/packages/blaspp/package.py b/var/spack/repos/builtin/packages/blaspp/package.py index 6be99028b1..f6f52d2756 100644 --- a/var/spack/repos/builtin/packages/blaspp/package.py +++ b/var/spack/repos/builtin/packages/blaspp/package.py @@ -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 @@ class Blaspp(CMakePackage, CudaPackage, ROCmPackage): backend = "cuda" if "+rocm" in spec: backend = "hip" + if "+sycl" in spec: + backend = "sycl" backend_config = "-Dgpu_backend=%s" % backend args = [ diff --git a/var/spack/repos/builtin/packages/lapackpp/package.py b/var/spack/repos/builtin/packages/lapackpp/package.py index fc14e547ff..1532d87843 100644 --- a/var/spack/repos/builtin/packages/lapackpp/package.py +++ b/var/spack/repos/builtin/packages/lapackpp/package.py @@ -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") - - conflicts("+rocm", when="+cuda", msg="LAPACK++ can only support one GPU backend at a time") + depends_on("intel-oneapi-mkl threads=openmp", when="+sycl") + + 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 @@ class Lapackpp(CMakePackage, CudaPackage, ROCmPackage): backend = "cuda" if "+rocm" in spec: backend = "hip" + if "+sycl" in spec: + backend = "sycl" args = [ "-DBUILD_SHARED_LIBS=%s" % ("+shared" in spec), diff --git a/var/spack/repos/builtin/packages/slate/package.py b/var/spack/repos/builtin/packages/slate/package.py index 7304155eb3..95b4e89580 100644 --- a/var/spack/repos/builtin/packages/slate/package.py +++ b/var/spack/repos/builtin/packages/slate/package.py @@ -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 @@ class Slate(CMakePackage, CudaPackage, ROCmPackage): backend = "cuda" if "+rocm" in spec: backend = "hip" + if "+sycl" in spec: + backend = "sycl" backend_config = "-Dgpu_backend=%s" % backend config = [ |