Page 1 of 1

zlaset_identity

Posted: Mon Oct 06, 2014 10:10 pm
by hsahasra
Hi,

I was using magmablas_zlaset_identity to create an identity matrix on GPU. I can't find it in MAGMA 1.5.0. Can you suggest an alternative that is present in the newest version?

Thanks,
Harshad

Re: zlaset_identity

Posted: Tue Oct 07, 2014 10:22 am
by mgates3
We updated the laset interface to match LAPACK's laset, with offdiag (alpha) and diag (beta).

Code: Select all

c_zero = MAGMA_Z_ZERO;
c_one  = MAGMA_Z_ONE;
magmabas_zlaset( MagmaFull, m, n, c_zero, c_one, dA, ldda );  // set to identity
In real arithmetic the constants can be inline:

Code: Select all

magmabas_dlaset( MagmaFull, m, n, 0, 1, dA, ldda );  // set to identity
This is a lot more flexible. You can set the full matrix or only the upper or lower triangle, set to any multiple of the identity, etc. See documentation:
http://icl.cs.utk.edu/projectsfiles/mag ... a6072a47ed

-mark

Re: zlaset_identity

Posted: Tue Oct 07, 2014 12:13 pm
by hsahasra
Thank you!