From 3e2721ac7f89168dadad6e9d9a2662626c3240d2 Mon Sep 17 00:00:00 2001 From: eugeneswalker <38933153+eugeneswalker@users.noreply.github.com> Date: Fri, 20 Jan 2023 07:43:05 -0600 Subject: hypre: add option for sycl variant (#34987) * hypre: add option for sycl variant * hypre +sycl conflicts with @:2.23 * hypre +sycl: raise InstallError for unsupported compiler --- var/spack/repos/builtin/packages/hypre/package.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py index 931609012a..5632489601 100644 --- a/var/spack/repos/builtin/packages/hypre/package.py +++ b/var/spack/repos/builtin/packages/hypre/package.py @@ -75,6 +75,7 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage): variant("fortran", default=True, description="Enables fortran bindings") variant("gptune", default=False, description="Add the GPTune hookup code") variant("umpire", default=False, description="Enable Umpire support") + variant("sycl", default=False, description="Enable SYCL support") # Patch to add gptune hookup codes patch("ij_gptune.patch", when="+gptune@2.19.0") @@ -139,6 +140,9 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage): # Option added in v2.21.0 conflicts("+umpire", when="@:2.20") + # Option added in v2.24.0 + conflicts("+sycl", when="@:2.23") + configure_directory = "src" def url_for_version(self, version): @@ -270,6 +274,15 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage): ] ) + if "+sycl" in spec: + configure_args.append("--with-scyl") + sycl_compatible_compilers = ["dpcpp", "icpx"] + if not (os.path.basename(self.compiler.cxx) in sycl_compatible_compilers): + raise InstallError( + "Hypre's SYCL GPU Backend requires DPC++ (dpcpp)" + + " or the oneAPI CXX (icpx) compiler." + ) + if "+unified-memory" in spec: configure_args.append("--enable-unified-memory") -- cgit v1.2.3-60-g2f50