# Transfer a Sparse Matrix to a C Function

**URL:** <https://discourse.julialang.org/t/transfer-a-sparse-matrix-to-a-c-function/67883>\
**Category:** General Usage\
**Tags:** linearalgebra, sparse, c\
**Created:** [September 8, 2021, 6:04pm UTC](https://discourse.julialang.org/t/transfer-a-sparse-matrix-to-a-c-function/67883 "2021-09-08T18:04:15Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Post date:** [September 11, 2021, 7:48pm UTC](https://discourse.julialang.org/t/transfer-a-sparse-matrix-to-a-c-function/67883/14 "2021-09-11T19:48:26Z")

</div>

Yes. I have watched it. Though what I’m talking is mainly for the Sparse Matrices.  
Namely, what I’m asking is if both paths exist at once and if Julia chose the `LP` path for Sparse Matrices built with `Int32`.

The code on `MKLSparse` currently use `BlasInt` to chose the code path. It doesn’t even look at the matrix itself.  
This is what I’m talking about (Though I’d say the 3-4 last comments should appear on [Convert a Current Installation of Julia to Use `BlasInt = `Int32`](https://discourse.julialang.org/t/convert-a-current-installation-of-julia-to-use-blasint-int32/67915)).

The solution has 2 stages:

1. Allow, at the same time, accessing BLAS / LAPCAK / Sparse BLAS / LAPACK libraries with `Int32` and `Int64` API.
2. For Sparse Matrices chose the path based on the type of the indices. Go for `LP64` for Sparse Matrices with `Int32` / `UInt32` indices. Use the `ILP64` path for matrices built with `Int64` / `UInt64`. One could even say that the path can have AUTO mode for matrices with less than `2 ^ 31 - 1` elements (Be Sparse or Dense).

It will bring performance and memory optimization for the eco system.

---

_[View the full topic](https://discourse.julialang.org/t/transfer-a-sparse-matrix-to-a-c-function/67883)._
