MAGMA problem in HiPLARb

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)

MAGMA problem in HiPLARb

Postby jcbowden12 » Wed May 13, 2015 10:52 pm

I realise this is not the best place for getting help with HiPLARb, however any help is better than no help.

So, I am getting an error when I try to use the magma library part of HiPLARb for svd().

R: constants.cpp:412: const char *lapack_vec_const(magma_vec_t): Assertion `magma_const >= MagmaNoVec' failed.

If I call hiplarb_mode_plasma() and then run the svd() function there is no issue and the code completes correctly.

Any ideas why this may be?

Posts: 14
Joined: Tue Mar 06, 2012 2:36 am

Re: MAGMA problem in HiPLARb

Postby mgates3 » Thu May 14, 2015 11:34 am

It looks like they are assuming constants used in MAGMA 1.4 and earlier. The constants MagmaLower, MagmaUpper, etc. were changed from chars to enums in 1.5. The quickest fix is to change instances of *trans, *uplo, *job, *diag, etc. to, respectively:

Code: Select all
magma_trans_const( *trans )
magma_uplo_const( *uplo )
magma_job_const( *job )
magma_diag_const( *diag )

Here are instances that I could find using grep.

Code: Select all
src/HiPLARb> grep -R 'magma.*\* *(trans|job|uplo|side|diag)' .
./src/magma_matprod.c:        //magmablas_dgemm(*transa, *transb, nrx, ncy, ncx,
./src/magma_matprod.c:        magmablas_zgemm(*transa, *transb, nrx, ncy, ncx,
./src/magma_matprod.c:        magma_dsyrk(*uplo, *trans, nc, nr, one, d_A, nr, zero, d_C, nc);
./src/magma_matprod.c:        //magmablas_dgemm(*transa, *transb, ncx, ncy, nrx,
./src/magma_matprod.c:        magmablas_zgemm(*transa, *transb, ncx, ncy, nrx,
./src/magma_matprod.c:        magma_dsyrk(*uplo, *trans, nr, nc, one, d_A, nr, zero, d_C, nr);
./src/magma_matprod.c:        //magmablas_dgemm(*transa, *transb, nrx, nry, ncx,
./src/magma_matprod.c:        magmablas_zgemm(*transa, *transb, nrx, nry, ncx,
./src/magma_wrapper.c:      magmablas_dtrsm(*side, *uplo, *transa, *diag, *n, *nb, one, dA, *ldt, dB, *ldb);
./src/magma_wrapper.c:      magma_dgeev_m(*jobVL, *jobVR, n, xvals, n, wR, wI, left, n, right, n, &tmp, lwork, &info);
./src/magma_wrapper.c:      magma_dgeev(*jobVL, *jobVR, n, xvals, n, wR, wI,
./src/magma_wrapper.c:      magma_dgeev_m(*jobVL, *jobVR, n, xvals, n, wR, wI,
./src/magma_wrapper.c:      magma_dgeev(*jobVL, *jobVR, n, xvals, n, wR, wI,
./src/magma_wrapper.c:    magma_zgeev(*jobVL, *jobVR, n, (cuDoubleComplex *)xvals, n,
./src/magma_wrapper.c:    magma_zgeev(*jobVL, *jobVR, n, (cuDoubleComplex *)xvals, n,

Attached is an UNTESTED patch that should fix this. I don't have all the software dependencies installed to compile HiPLARb, nor know how to use it. Apply using patch, e.g.,

src/HiPLARb> patch -p1 < ../HiPLARb.patch
patching file src/magma_matprod.c
patching file src/magma_wrapper.c

Let us know how it goes. If that works, ideally it should be submitted to HiPLARb.

Other packages may need similar updates.

A cleaner fix would be to use magma_uplo_t, magma_trans_t, etc. types instead of char*, and MagmaLower, MagmaUpper, etc. constants instead of "L", "U", etc. These are documented here: ... tants.html

Patch for HiPLARb version 0.1.4
(7.72 KiB) Downloaded 28 times
Posts: 736
Joined: Fri Jan 06, 2012 2:13 pm

Re: MAGMA problem in HiPLARb

Postby jcbowden12 » Thu May 14, 2015 8:16 pm

Dear Mark,
Thanks for your reply, and the patch.

It does seem a problem with using a newer version of magma as we have tried an LD_PRELOAD of the magma 1.4.1 version and the problem went away.

I'll tell you how the patch works out though.

Posts: 14
Joined: Tue Mar 06, 2012 2:36 am

Re: MAGMA problem in HiPLARb

Postby fletchjp » Thu Aug 13, 2015 7:09 pm

Is there a location which charts the changes in interface which have happened with different versions of Magma?


Posts: 203
Joined: Mon Dec 27, 2010 7:29 pm

Re: MAGMA problem in HiPLARb

Postby jcbowden12 » Wed Jun 01, 2016 3:18 am

Hi again,
The as revived HiPLARb 0.1.4 code was all based on earlier MAGMA interface. I have gone through the package source code and changed the magma calls to use the magma_XYZ_const() constant conversion functions and all seems to work well with version 1.7.0 of MAGMA. HiPLARb seems to run into issues with MAGMA 2.0, however i'm leaving that problem for the moment.
Posts: 14
Joined: Tue Mar 06, 2012 2:36 am

Return to User discussion

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 2 guests