Use coo_array/ndarray with MKL #763
Unanswered
bentrainer
asked this question in
Q&A
Replies: 1 comment
-
Can you use a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, this may be a stupid question because I just started to learn C++ 😭.
I want to achieve a simple task using nanobind to call
mkl_sparse_z_trsm
in Python so I could solveAx=b
whereA
is a sparse upper triangular matrix (scipy.sparse.coo_array
) whileb
is a dense matrix (np.ndarray
).I have not dig into
coo_array
but stuck at theb
part withfoo(nb::ndarray<>& b)
. Because it's an complex array, I don't know how to convert it intoMKL_Complex16
type even though I think thenumpy
also use mkl to store the underlying data. I tried to pass theb.data()
into the mkl function but got:What is the correct way to convert it to a
MKL_Complex16
pointer?BTW, the reason I want to try this rather than simply go
spsolve_triangular
orspsolve
fromscipy.sparse.linalg
is because they are way slow compared to MATLAB. I want to figure out where the performance goes...Beta Was this translation helpful? Give feedback.
All reactions