forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add double batched FFT library package (spack#36086)
* Add double batched FFT library package * Fix style * Add error when unsupported compiler is uesd --------- Signed-off-by: Carsten Uphoff <carsten.uphoff@intel.com>
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
var/spack/repos/builtin/packages/double-batched-fft-library/package.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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), | ||
] |