Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

Const correctness

asd__asdqwe
Beginner
146 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
146 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.

Gennady_F_Intel
Moderator
146 Views

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

Reply