At the moment I’m trying to build a COO using the CUSPARSE library. Looking at the documentation, and the function arguments, the way to create this is using the row and column indices followed by the values of each element and the matrix dimension.
using CUDA, SparseArrays
K_rows = [0, 1, 1, 2]
K_cols = [0, 0, 2, 1]
K_vals = [10.0, 20.0, 30.0, 40.0]
a = CUDA.CUSPARSE.CuSparseMatrixCOO{Float64,Int64}(
CuArray(K_rows), CuArray(K_cols), CuArray(K_vals),
(3,3)
)
display(a)
However, when running this code, the following error occurs:
ERROR: LoadError: BoundsError: attempt to access 4-element CuArray{Float64, 1, CUDA.DeviceMemory} at index [[4294967297, 8589934596, 1, 1]]
Am I missing something trivial here?
Julia version is at 1.11.1
2