depot/third_party/nixpkgs/pkgs/development/python-modules/torch/tests.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

31 lines
1,011 B
Nix

{ callPackage }:
rec {
# To perform the runtime check use either
# `nix run .#python3Packages.torch.tests.tester-cudaAvailable` (outside the sandbox), or
# `nix build .#python3Packages.torch.tests.tester-cudaAvailable.gpuCheck` (in a relaxed sandbox)
tester-cudaAvailable = callPackage ./mk-runtime-check.nix {
feature = "cuda";
versionAttr = "cuda";
libraries = ps: [ ps.torchWithCuda ];
};
tester-rocmAvailable = callPackage ./mk-runtime-check.nix {
feature = "rocm";
versionAttr = "hip";
libraries = ps: [ ps.torchWithRocm ];
};
compileCpu = tester-compileCpu.gpuCheck;
tester-compileCpu = callPackage ./mk-torch-compile-check.nix {
feature = null;
libraries = ps: [ ps.torch ];
};
tester-compileCuda = callPackage ./mk-torch-compile-check.nix {
feature = "cuda";
libraries = ps: [ ps.torchWithCuda ];
};
tester-compileRocm = callPackage ./mk-torch-compile-check.nix {
feature = "rocm";
libraries = ps: [ ps.torchWithRocm ];
};
}