Page 1 of 1

Shuld be 'const' some vector imput arguments in CULA?

PostPosted: Fri May 10, 2013 10:59 am
by jgpallero
Hello:
First of all, this is my first message, so I apologize if thist question is posted in an incorrect section of the forum.

I see that all CULA functions like culaDpotrs, culaDgetri, culaDgetrs, for example, declare its vector arguments A and ipiv (where is needed) simply as
Code: Select all
culaDouble* A

and
Code: Select all
culaInt* ipiv


In these cases A and ipiv are not modified by the function so the common practice is declare them as
Code: Select all
const double* A

and
Code: Select all
const int* ipiv

as, for example, LAPACKE and ATLAS do.

I think it is a good practice and I suggest it in CULA. On the other hand, this practice will prevents compiler warnings when these arguments are passed as const, for example if we are programming some wrapper in order to select to use CULA or other Lapack implementation as LAPACKE, Intel MKL or ATLAS

Re: Shuld be 'const' some vector imput arguments in CULA?

PostPosted: Fri May 10, 2013 12:54 pm
by john
We actually targeted CLAPACK for closest compatibility, and it doesn't mark arguments as const, so we matched that. But marking the interface properly const is something we consider doing.