Create a GPU-aware sparse matrix
Value
A cudasparse list. Stable public metadata include one-based COO
i and j, numeric values, zero-based CSR row_ptr and col_index,
integer shape, matrix dimnames, logical format, actual device, and
backend. storage is backend-internal and should not be accessed
directly.
Details
Existing cudasparse inputs use their stable sorted COO mirror
directly. Same-device format changes share backend storage; transfers and
zero filtering do not construct an intermediate Matrix object.
Examples
library(Matrix)
x <- rsparsematrix(5, 4, density = 0.25)
cuda_sparse(x, device = "cpu")
#> <cudasparse[5x4] nnz=5 format=csr device=cpu backend=Matrix>
#> 5 x 4 sparse Matrix of class "dgCMatrix"
#>
#> [1,] . . . .
#> [2,] . . -0.97 .
#> [3,] . 0.69 . .
#> [4,] -0.96 0.80 . .
#> [5,] -0.48 . . .