Dear all,
I have a question regarding the const-correctness in header files. Let's take for example
magma_int_t magma_dgetrs_gpu( char trans, magma_int_t n, magma_int_t nrhs, double *dA, magma_int_t ldda, magma_int_t *ipiv, double *dB, magma_int_t lddb, magma_int_t *info);
If I look in the source code, I would expect a different definition:
magma_int_t magma_dgetrs_gpu( char trans, magma_int_t n, magma_int_t nrhs, const double *dA, magma_int_t ldda, const magma_int_t *ipiv, double *dB, magma_int_t lddb, magma_int_t *info);
since the matrix A and the vector piv are not changed by the function. The same holds for some other functions.
In contrast, the function magma_dprint and magma_dprint_gpu are defined with the const attribute.
CUBLAS also uses it in the declarations.
So, why are the const attributes often missing in MAGMA? It would be helpful the have them.
const-correctness in header files
Re: const-correctness in header files
You are correct. It's a historical oversight that will eventually get fixed, but needs to be propagated down to the lowest level (e.g., BLAS) first.
-mark
-mark