|
| 1 | +# Copyright Spack Project Developers. See COPYRIGHT file for details. |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: (Apache-2.0 OR MIT) |
| 4 | + |
| 5 | +import platform |
| 6 | + |
| 7 | +from spack.package import * |
| 8 | + |
| 9 | + |
| 10 | +class Cusparselt(Package): |
| 11 | + """A high-performance CUDA library dedicated to general matrix-matrix operations |
| 12 | + in which at least one operand is a structured sparse matrix with 50% sparsity ratio.""" |
| 13 | + |
| 14 | + homepage = "https://docs.nvidia.com/cuda/cusparselt/" |
| 15 | + |
| 16 | + skip_version_audit = ["platform=darwin", "platform=windows"] |
| 17 | + |
| 18 | + maintainers("thomas-bouvier") |
| 19 | + |
| 20 | + system = platform.system().lower() |
| 21 | + arch = platform.machine() |
| 22 | + if "linux" in system and arch == "x86_64": |
| 23 | + # version( |
| 24 | + # "0.8.1-cuda130", |
| 25 | + # sha256="82dd3e5ebc199a27011f58857a80cd825e77bba634ab2286ba3d4e13115db89a", |
| 26 | + # url="https://developer.download.nvidia.com/compute/cusparselt/redist/libcusparse_lt/linux-x86_64/libcusparse_lt-linux-x86_64-0.8.1.1_cuda13-archive.tar.xz", |
| 27 | + # ) |
| 28 | + version( |
| 29 | + "0.8.1-cuda120", |
| 30 | + sha256="b34272e683e9f798435af05dc124657d1444cd0e13802c3d2f3152e31cd898a3", |
| 31 | + url="https://developer.download.nvidia.com/compute/cusparselt/redist/libcusparse_lt/linux-x86_64/libcusparse_lt-linux-x86_64-0.8.1.1_cuda12-archive.tar.xz", |
| 32 | + ) |
| 33 | + elif "linux" in system and arch == "aarch64": |
| 34 | + # version( |
| 35 | + # "0.8.1-cuda130", |
| 36 | + # sha256="0fcf5808f66c71f755b4a73af2e955292e4334fec6a851eea1ac2e20878602b7", |
| 37 | + # url="https://developer.download.nvidia.com/compute/cusparselt/redist/libcusparse_lt/linux-aarch64/libcusparse_lt-linux-aarch64-0.8.1.1_cuda13-archive.tar.xz", |
| 38 | + # ) |
| 39 | + version( |
| 40 | + "0.8.1-cuda120", |
| 41 | + sha256="5426a897c73a9b98a83c4e132d15abc63dc4a00f7e38266e7b82c42cd58a01e1", |
| 42 | + url="https://developer.download.nvidia.com/compute/cusparselt/redist/libcusparse_lt/linux-aarch64/libcusparse_lt-linux-aarch64-0.8.1.1_cuda12-archive.tar.xz", |
| 43 | + ) |
| 44 | + |
| 45 | + # cuda130_versions = ("@0.8.1-cuda130",) |
| 46 | + cuda120_versions = ("@0.8.1-cuda120",) |
| 47 | + |
| 48 | + # for v in cuda130_versions: |
| 49 | + # depends_on("cuda@13", when=v, type=("build", "run")) |
| 50 | + for v in cuda120_versions: |
| 51 | + depends_on("cuda@12", when=v, type=("build", "run")) |
| 52 | + |
| 53 | + depends_on("c", type="build") |
| 54 | + depends_on("cxx", type="build") |
| 55 | + |
| 56 | + # Installation instructions |
| 57 | + def install(self, spec, prefix): |
| 58 | + # Create installation directories |
| 59 | + mkdirp(prefix.lib) |
| 60 | + mkdirp(prefix.include) |
| 61 | + |
| 62 | + # Copy library files |
| 63 | + install_tree("lib", prefix.lib) |
| 64 | + |
| 65 | + # Copy header files |
| 66 | + install_tree("include", prefix.include) |
0 commit comments