Files
nixpkgs/pkgs/development/cuda-modules/tests/flags.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

80 lines
1.7 KiB
Nix

{
_cuda,
cudaNamePrefix,
lib,
runCommand,
}:
let
inherit (builtins) deepSeq toJSON tryEval;
inherit (_cuda.bootstrapData) cudaCapabilityToInfo;
inherit (_cuda.lib) formatCapabilities;
inherit (lib.asserts) assertMsg;
in
# When changing names or formats: pause, validate, and update the assert
assert assertMsg (
cudaCapabilityToInfo ? "7.5" && cudaCapabilityToInfo ? "8.6"
) "The following test requires both 7.5 and 8.6 be known CUDA capabilities";
assert
let
expected = {
cudaCapabilities = [
"7.5"
"8.6"
];
cudaForwardCompat = true;
# Sorted alphabetically
archNames = [
"Ampere"
"Turing"
];
realArches = [
"sm_75"
"sm_86"
];
virtualArches = [
"compute_75"
"compute_86"
];
arches = [
"sm_75"
"sm_86"
"compute_86"
];
gencode = [
"-gencode=arch=compute_75,code=sm_75"
"-gencode=arch=compute_86,code=sm_86"
"-gencode=arch=compute_86,code=compute_86"
];
gencodeString = "-gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_86,code=sm_86 -gencode=arch=compute_86,code=compute_86";
cmakeCudaArchitecturesString = "75;86";
};
actual = formatCapabilities {
inherit cudaCapabilityToInfo;
cudaCapabilities = [
"7.5"
"8.6"
];
cudaForwardCompat = true;
};
actualWrapped = (tryEval (deepSeq actual actual)).value;
in
assertMsg (expected == actualWrapped) ''
Expected: ${toJSON expected}
Actual: ${toJSON actualWrapped}
'';
runCommand "${cudaNamePrefix}-tests-flags"
{
__structuredAttrs = true;
strictDeps = true;
}
''
touch "$out"
''