15 else if config.rocmSupport
21 assert builtins.elem gpuBackend [ "none" "cuda" "rocm" ];
23 stdenv.mkDerivation rec {
27 src = fetchFromGitHub {
31 hash = "sha256-hZdB/QcjL8rjvR1YZS+CHe5U5zxedpfDq6msMih4Elc=";
37 ] ++ lib.optional (gpuBackend == "cuda") cudaPackages.cuda_nvcc;
42 ] ++ lib.optionals (gpuBackend == "cuda") [
44 cudaPackages.cuda_cudart
45 ] ++ lib.optionals (gpuBackend == "rocm") [
49 ] ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp
55 "-DSPFFT_SINGLE_PRECISION=OFF"
57 # Required due to broken CMake files
58 "-DCMAKE_INSTALL_LIBDIR=lib"
59 "-DCMAKE_INSTALL_INCLUDEDIR=include"
61 ++ lib.optional (gpuBackend == "cuda") "-DSPFFT_GPU_BACKEND=CUDA"
62 ++ lib.optionals (gpuBackend == "rocm") [
63 "-DSPFFT_GPU_BACKEND=ROCM"
64 "-DHIP_ROOT_DIR=${rocmPackages.clr}"
69 description = "Sparse 3D FFT library with MPI, OpenMP, CUDA and ROCm support";
70 homepage = "https://github.com/eth-cscs/SpFFT";
71 license = licenses.bsd3;
72 maintainers = [ maintainers.sheepforce ];
73 platforms = platforms.linux;