Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Const correctness

asd__asdqwe
Beginner
334 Views

Hello,

Is there a reason the parameters of mkl_sparse_?_create_[b|c]sr are of type C_INT or C_[FLOAT|DOUBLE|FLOAT_COMPLEX|DOUBLE_COMPLEX] instead of const C_INT const or const C_[FLOAT|DOUBLE|FLOAT_COMPLEX|DOUBLE_COMPLEX] const? Do you modify the pointers or the values provided by the user? I currently need to use ugly const_cast because my pointers are of type const T* const. E.g.,

            mkl_sparse_d_create_bsr(&bsr, SPARSE_INDEX_BASE_ONE, SPARSE_LAYOUT_COLUMN_MAJOR, *m, *k, *bs, const_cast<int*>(ia), const_cast<int*>(ia + 1), const_cast<int*>(ja), const_cast<double*>(a));

Any chance this could get fixed?

Thanks.

0 Kudos
2 Replies
Gennady_F_Intel
Moderator
334 Views

Yes, we definitely should add this. we should add const modifier to many others SpBLAS IE API. We will keep you posted with on the progress.

0 Kudos
Gennady_F_Intel
Moderator
334 Views

The issue has been fixed into the latest v2020 which was released the last week. 

0 Kudos
Reply