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

Feature request: double * const * const, please

Petros_Mamales
Beginner
637 Views

Hi,

I would like to put in a feature request for MKL:

 Currently, the c interface of mkl does not provide for const pointers. It only does for pointers to const ( i.e. double const * and not double const * const ) - the latter meaning that the pointer itself is not changing as well and not only what it points to (through it, to be exact).

This results in a lot of const (un)casting when one tries to write wrapper classes, since any sensible c++ programmer would provide with 2 versions of the (example, schematically) container data:

double * data() { return ptr_ ; }

double const * const data() const { return ptr_ ;}

This creates a logical havoc when writing lapack/blas wrappers. Would you please consider correcting it ? 

 

0 Kudos
2 Replies
Gennady_F_Intel
Moderator
637 Views

thanks Petros, we will consider this request into one of the next releases of Intel MKL.

0 Kudos
Dmitry_B_Intel
Employee
637 Views

Hi Petros,

Could you give a more detailed example which demonstrates the problem? Many C interfaces accept pointers by value, and function is allowed to change these parameters because the change will not affect corresponding arguments. If a function has a 'const T' parameter of a non-reference type T, then const qualifier is disregarded in many respects. For example, one cannot overload a function with a parameter of non-reference type T by making the parameter 'const T'.

Thanks
Dima

0 Kudos
Reply