intel-mkl-src icon indicating copy to clipboard operation
intel-mkl-src copied to clipboard

Why not bindgen the whole `mkl.h` in wrapper?

Open tuxzz opened this issue 5 years ago • 2 comments

I want to use mkl_sparse_* functions but I found that intel-mkl-sys only bindgened mkl_vml.h and mkl_vsl.h.

What's the purpose that not bindgen the whole mkl.h in wrapper? May I create a PR to fix it?

tuxzz avatar Aug 22 '20 16:08 tuxzz

What's the purpose that not bindgen the whole mkl.h in wrapper?

It intends not to include unnecessary function or structs. Using rust-bindgen, it will expose ALL functions defined in C header including those defined in e.g. stdio.h. VML and VSL headers are clean enough not to use white-listing like, e.g. I did for cuda-driver-sys, and they are in needs of https://github.com/rust-ndarray/ndarray-linalg/pull/178

May I create a PR to fix it?

Welcome :) You may find another bindgen.sh example in cuda-runtime-sys and https://github.com/blas-lapack-rs/lapack-sys/pull/11

termoshtt avatar Aug 22 '20 18:08 termoshtt

This is the purpose of our mkl-sys crate (not published to crates.io). Although not by any means perfect (MKL is really unfriendly to wrapping), it has allowed us to build wrappers for e.g. sparse solvers and sparse linear algebra.

I'd like to avoid an MKL "ecosystem split", and I could imagine contributing what we've done to this crate, as well as future improvements.

However, for us a concern of major importance is the fact that the download feature is on by default. I think for us to contribute our work (if you're interested) I'd really like to urge you to make this off by default. I'll open a separate issue for this, however.

EDIT: Issue is here: #67

Andlon avatar Sep 24 '21 09:09 Andlon