zlaset_identity

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)
Post Reply
hsahasra
Posts: 32
Joined: Mon Jun 24, 2013 3:40 pm

zlaset_identity

Post by hsahasra » Mon Oct 06, 2014 10:10 pm

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

mgates3
Posts: 918
Joined: Fri Jan 06, 2012 2:13 pm

Re: zlaset_identity

Post by mgates3 » Tue Oct 07, 2014 10:22 am

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

hsahasra
Posts: 32
Joined: Mon Jun 24, 2013 3:40 pm

Re: zlaset_identity

Post by hsahasra » Tue Oct 07, 2014 12:13 pm

Thank you!

Post Reply