From bfca1729fac06f813a59829801a7a1d0c6959f21 Mon Sep 17 00:00:00 2001 From: Carsten Uphoff Date: Tue, 21 Mar 2023 00:25:37 +0100 Subject: [PATCH] Add double batched FFT library package (#36086) * Add double batched FFT library package * Fix style * Add error when unsupported compiler is uesd --------- Signed-off-by: Carsten Uphoff --- .../double-batched-fft-library/package.py | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 var/spack/repos/builtin/packages/double-batched-fft-library/package.py diff --git a/var/spack/repos/builtin/packages/double-batched-fft-library/package.py b/var/spack/repos/builtin/packages/double-batched-fft-library/package.py new file mode 100644 index 0000000000..8de16eaeee --- /dev/null +++ b/var/spack/repos/builtin/packages/double-batched-fft-library/package.py @@ -0,0 +1,51 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os + +from spack.package import * + + +class DoubleBatchedFftLibrary(CMakePackage): + """A library for computing the Discrete Fourier Transform; + targeting Graphics Processing Units; supporting OpenCL, + Level Zero, and SYCL; with double-batching.""" + + homepage = "https://github.com/intel/double-batched-fft-library" + url = "https://github.com/intel/double-batched-fft-library/archive/refs/tags/v0.3.6.tar.gz" + git = "https://github.com/intel/double-batched-fft-library.git" + + maintainers = ["uphoffc"] + + version("main", branch="main") + version("develop", branch="develop") + version("0.3.6", sha256="ff163251d77d3c686563141e871c702bf4997c0302d53616add55d6cf9b02d28") + + variant("shared", default=True, description="Shared library") + variant("sycl", default=True, description="Build bbfft-sycl") + variant("level-zero", default=True, when="~sycl", description="Build bbfft-level-zero") + variant("opencl", default=True, when="~sycl", description="Build bbfft-opencl") + + depends_on("cmake@3.23.0:", type="build") + depends_on("oneapi-level-zero", when="+sycl") + depends_on("oneapi-level-zero", when="+level-zero") + depends_on("opencl", when="+opencl") + + def cmake_args(self): + cxx_compiler = os.path.basename(self.compiler.cxx) + if self.spec.satisfies("+sycl") and cxx_compiler not in ["icpx", "dpcpp"]: + raise InstallError( + "The Double-Batched FFT Library requires the oneapi DPC++/C++ Compiler" + ) + + return [ + self.define_from_variant("BUILD_SHARED_LIBS", "shared"), + self.define_from_variant("BUILD_SYCL", "sycl"), + self.define_from_variant("BUILD_LEVEL_ZERO", "level-zero"), + self.define_from_variant("BUILD_OPENCL", "opencl"), + self.define("BUILD_BENCHMARK", False), + self.define("BUILD_EXAMPLE", False), + self.define("BUILD_TESTING", False), + ]