depot/third_party/nixpkgs/pkgs/development/cuda-modules/write-gpu-python-test.nix
Default email 98eb3e9ef5 Project import generated by Copybara.
GitOrigin-RevId: 00d80d13810dbfea8ab4ed1009b09100cca86ba8
2024-07-01 15:47:52 +00:00

29 lines
550 B
Nix

{
lib,
writers,
runCommand,
}:
{
feature ? "cuda",
name ? feature,
libraries ? [ ],
}:
content:
let
tester = writers.writePython3Bin "tester-${name}" { inherit libraries; } content;
tester' = tester.overrideAttrs (oldAttrs: {
passthru.gpuCheck =
runCommand "test-${name}"
{
nativeBuildInputs = [ tester' ];
requiredSystemFeatures = [ feature ];
}
''
set -e
${tester.meta.mainProgram or (lib.getName tester')}
touch $out
'';
});
in
tester'