1{
2 cuda_cudart ? null,
3 cudaAtLeast,
4 cudaOlder,
5 cudatoolkit,
6 lib,
7 libcublas ? null,
8}:
9finalAttrs: prevAttrs: {
10 buildInputs =
11 prevAttrs.buildInputs or [ ]
12 ++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ]
13 ++ lib.optionals (cudaAtLeast "11.4") (
14 [ (libcublas.lib or null) ]
15 # For some reason, the 1.4.x release of cusparselt requires the cudart library.
16 ++ lib.optionals (lib.hasPrefix "1.4" finalAttrs.version) [ (cuda_cudart.lib or null) ]
17 );
18 meta = prevAttrs.meta or { } // {
19 description = "cuSPARSELt: A High-Performance CUDA Library for Sparse Matrix-Matrix Multiplication";
20 homepage = "https://developer.nvidia.com/cusparselt-downloads";
21 # TODO(@connorbaker): Temporary workaround to avoid changing the derivation hash since introducing more
22 # brokenConditions would change the derivation as they're top-level and __structuredAttrs is set.
23 broken =
24 prevAttrs.meta.broken or false
25 || (
26 cudaAtLeast "11.4"
27 && (libcublas == null || (lib.hasPrefix "1.4" finalAttrs.version && cuda_cudart == null))
28 );
29 maintainers = prevAttrs.meta.maintainers or [ ] ++ [ lib.maintainers.sepiabrown ];
30 teams = prevAttrs.meta.teams or [ ];
31 license = lib.licenses.unfreeRedistributable // {
32 shortName = "cuSPARSELt EULA";
33 fullName = "cuSPARSELt SUPPLEMENT TO SOFTWARE LICENSE AGREEMENT FOR NVIDIA SOFTWARE DEVELOPMENT KITS";
34 url = "https://docs.nvidia.com/cuda/cusparselt/license.html";
35 };
36 };
37}