-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
copyless conversion of full GBVector and GBMatrix into Arrays #107
Comments
Check out pack.jl and unpack.jl I haven't rigorously documented them yet because they're difficult to make "safe" |
If you need both at the same time (the reinterpret and the original) I don't have a great option other than repacking and holding onto the pointers. If you don't modify then they "should" remain the same. But you could easily segfault on GC. |
Thanks, that is what I was looking for. julia> a = rand(2,2)
2×2 Matrix{Float64}:
0.823637 0.396913
0.44517 0.924361
julia> x = SuiteSparseGraphBLAS.pack(a)
2x2 GraphBLAS double matrix, full by col
4 entries, memory: 208 bytes
(1,1) 0.823637
(2,1) 0.44517
(1,2) 0.396913
(2,2) 0.924361
julia> a[1,1] = 5
5
julia> x
2x2 GraphBLAS double matrix, full by col
4 entries, memory: 208 bytes
(1,1) 5
(2,1) 0.44517
(1,2) 0.396913
(2,2) 0.924361
The other direction is with z = SuiteSparseGraphBLAS._unpackdensematrix!(x) |
I'll leave the issue open until the API is finalized and documented |
So try to use methods without the |
Specifically the semantics of
Once you've packed
|
Can we implement something like
reinterpret
here?The text was updated successfully, but these errors were encountered: