2023-07-15 17:15:38 +00:00
|
|
|
{ rocfft
|
|
|
|
, lib
|
2022-11-04 12:27:35 +00:00
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2022-12-17 10:02:37 +00:00
|
|
|
, rocmUpdateScript
|
2022-11-04 12:27:35 +00:00
|
|
|
, cmake
|
2023-10-19 13:55:26 +00:00
|
|
|
, clr
|
2022-11-04 12:27:35 +00:00
|
|
|
, python3
|
2023-07-15 17:15:38 +00:00
|
|
|
, rocm-cmake
|
|
|
|
, sqlite
|
2022-12-02 08:20:57 +00:00
|
|
|
, boost
|
|
|
|
, fftw
|
|
|
|
, fftwFloat
|
2023-07-15 17:15:38 +00:00
|
|
|
, gtest
|
|
|
|
, openmp
|
|
|
|
, rocrand
|
2023-10-19 13:55:26 +00:00
|
|
|
, gpuTargets ? [ ]
|
2022-11-04 12:27:35 +00:00
|
|
|
}:
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "rocfft";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "5.7.1";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-01-02 11:29:13 +00:00
|
|
|
owner = "ROCm";
|
2023-07-15 17:15:38 +00:00
|
|
|
repo = "rocFFT";
|
|
|
|
rev = "rocm-${finalAttrs.version}";
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-GZSi03geTT+NUztBWhGYyghLqJGsFjUQzVAKQ7d03uA=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2023-10-19 13:55:26 +00:00
|
|
|
clr
|
2023-07-15 17:15:38 +00:00
|
|
|
python3
|
|
|
|
rocm-cmake
|
|
|
|
];
|
2022-11-04 12:27:35 +00:00
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
buildInputs = [ sqlite ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_C_COMPILER=hipcc"
|
|
|
|
"-DCMAKE_CXX_COMPILER=hipcc"
|
|
|
|
"-DSQLITE_USE_SYSTEM_PACKAGE=ON"
|
|
|
|
# Manually define CMAKE_INSTALL_<DIR>
|
|
|
|
# See: https://github.com/NixOS/nixpkgs/pull/197838
|
|
|
|
"-DCMAKE_INSTALL_BINDIR=bin"
|
|
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
|
|
|
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
2023-10-19 13:55:26 +00:00
|
|
|
] ++ lib.optionals (gpuTargets != [ ]) [
|
2023-07-15 17:15:38 +00:00
|
|
|
"-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}"
|
|
|
|
];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru = {
|
|
|
|
test = stdenv.mkDerivation {
|
|
|
|
pname = "${finalAttrs.pname}-test";
|
|
|
|
inherit (finalAttrs) version src;
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
sourceRoot = "${finalAttrs.src.name}/clients/tests";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2023-10-19 13:55:26 +00:00
|
|
|
clr
|
2023-07-15 17:15:38 +00:00
|
|
|
rocm-cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
fftw
|
|
|
|
fftwFloat
|
|
|
|
finalAttrs.finalPackage
|
|
|
|
gtest
|
|
|
|
openmp
|
|
|
|
rocrand
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_C_COMPILER=hipcc"
|
|
|
|
"-DCMAKE_CXX_COMPILER=hipcc"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm -r "$out/lib/fftw"
|
|
|
|
rmdir "$out/lib"
|
|
|
|
'';
|
|
|
|
};
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
benchmark = stdenv.mkDerivation {
|
|
|
|
pname = "${finalAttrs.pname}-benchmark";
|
|
|
|
inherit (finalAttrs) version src;
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
sourceRoot = "${finalAttrs.src.name}/clients/rider";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2023-10-19 13:55:26 +00:00
|
|
|
clr
|
2023-07-15 17:15:38 +00:00
|
|
|
rocm-cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
finalAttrs.finalPackage
|
|
|
|
openmp
|
|
|
|
(python3.withPackages (ps: with ps; [
|
|
|
|
pandas
|
|
|
|
scipy
|
|
|
|
]))
|
|
|
|
rocrand
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_C_COMPILER=hipcc"
|
|
|
|
"-DCMAKE_CXX_COMPILER=hipcc"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cp -a ../../../scripts/perf "$out/bin"
|
|
|
|
'';
|
|
|
|
};
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
samples = stdenv.mkDerivation {
|
|
|
|
pname = "${finalAttrs.pname}-samples";
|
|
|
|
inherit (finalAttrs) version src;
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
sourceRoot = "${finalAttrs.src.name}/clients/samples";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2023-10-19 13:55:26 +00:00
|
|
|
clr
|
2023-07-15 17:15:38 +00:00
|
|
|
rocm-cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
finalAttrs.finalPackage
|
|
|
|
openmp
|
|
|
|
rocrand
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_C_COMPILER=hipcc"
|
|
|
|
"-DCMAKE_CXX_COMPILER=hipcc"
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir "$out"
|
|
|
|
cp -a bin "$out"
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
updateScript = rocmUpdateScript {
|
|
|
|
name = finalAttrs.pname;
|
|
|
|
owner = finalAttrs.src.owner;
|
|
|
|
repo = finalAttrs.src.repo;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
requiredSystemFeatures = [ "big-parallel" ];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "FFT implementation for ROCm";
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://github.com/ROCm/rocFFT";
|
2023-07-15 17:15:38 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ kira-bruneau ] ++ teams.rocm.members;
|
|
|
|
platforms = platforms.linux;
|
2024-01-02 11:29:13 +00:00
|
|
|
broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "6.0.0";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
})
|