rocfft: restructure to allow hydra caching

This commit is contained in:
Madoura 2023-01-16 17:24:56 -06:00
parent 18c88296d0
commit 731b7a0c77
No known key found for this signature in database
GPG key ID: 3201136B3DB072F9

View file

@ -2,6 +2,7 @@
, stdenv
, fetchFromGitHub
, rocmUpdateScript
, runCommand
, cmake
, rocm-cmake
, hip
@ -16,7 +17,8 @@
, buildBenchmarks ? false
}:
stdenv.mkDerivation (finalAttrs: {
let
rocfft = stdenv.mkDerivation (finalAttrs: {
pname = "rocfft";
version = "5.4.2";
@ -104,6 +106,50 @@ stdenv.mkDerivation (finalAttrs: {
license = with licenses; [ mit ];
maintainers = teams.rocm.members;
broken = versions.minor finalAttrs.version != versions.minor hip.version;
hydraPlatforms = [ ]; # rocFFT produces an extremely large output
};
})
});
rocfft-zero = runCommand "rocfft-zero" { preferLocalBuild = true; } ''
mkdir -p $out
cp -a ${rocfft}/lib/librocfft-device-0* $out
'';
rocfft-one = runCommand "rocfft-one" { preferLocalBuild = true; } ''
mkdir -p $out
cp -a ${rocfft}/lib/librocfft-device-1* $out
'';
rocfft-two = runCommand "rocfft-two" { preferLocalBuild = true; } ''
mkdir -p $out
cp -a ${rocfft}/lib/librocfft-device-2* $out
'';
rocfft-three = runCommand "rocfft-three" { preferLocalBuild = true; } ''
mkdir -p $out
cp -a ${rocfft}/lib/librocfft-device-3* $out
'';
in stdenv.mkDerivation {
inherit (rocfft) pname version outputs src passthru meta;
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/lib
for path in ${rocfft-zero} ${rocfft-one} ${rocfft-two} ${rocfft-three}; do
cp -as $path/* $out/lib
done
cp -an ${rocfft}/* $out
'' + lib.optionalString buildTests ''
cp -a ${rocfft.test} $test
'' + lib.optionalString buildBenchmarks ''
cp -a ${rocfft.benchmark} $benchmark
'' + ''
runHook postInstall
'';
}