I have just noticed something while reading the source code of magma_?trtri:
- Code: Select all
#define A(i, j) (a +(j)*lda + (i))
...
/* Check for singularity if non-unit */
if (nounit)
{
for (*info=0; *info < n; *info=*info+1)
{
if(A(*info,*info)==0)
return *info;
}
*info=0;
}
It seems you are comparing the pointer address with 0 instead of checking the corresponding value *A(*info,*info).
A similar problem exists in magma_?trtri_gpu
- Code: Select all
#define dA(i, j) (dA+(j)*ldda + (i))
...
/* Check for singularity if non-unit */
if (nounit)
{
for (*info=0; *info < n; *info=*info+1)
{
if(dA(*info,*info)==0)
return *info;
}
*info=0;
}
I don't think this code makes sense when dA is on the GPU memory. The only reason it doesn't crash is that the pointer address is being compared to 0 instead of the corresponding value (which you can't get just by dereferencing the pointer if I'm not mistaken).
Rémi
