Magma compiling with MPF failed

Open discussion for MAGMA

Magma compiling with MPF failed

Postby bala » Fri Apr 20, 2012 1:39 am

Hello,
I have downloaded and installed Magma 1.1.0 and generated two libraries namely libmagma.a and libmagmablas.a. I wanted to compile MPF with this magma libraries and it lands in trouble. The configuration script of MPF looks for sgemm_ routine in the blas libraries and could not find them in magma blas libraries. Any hint on this? If sgemm_ routine is not available with magma blas, then how about developing a wrapper for that or is there any other way to fix this at this level itself?

I tried writing a small wrapper for the routines (z/d/cs)gemm_ in which, say, a routine cblas_sgemm() is being developed which in turn invoke magmablas_sgemm(). Here, I end up type conversion issue as listed below

src/wrapper.cpp: In function ‘void cblas_zgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, const void*, const void*, int, const void*, int, const void*, void*, int)’:
src/wrapper.cpp:93: error: conversion from ‘const void*’ to non-scalar type ‘cuDoubleComplex’ requested
src/wrapper.cpp: At global scope:
src/wrapper.cpp:87: warning: unused parameter ‘Order’
src/wrapper.cpp: In function ‘void cblas_cgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, const void*, const void*, int, const void*, int, const void*, void*, int)’:
src/wrapper.cpp:104: error: conversion from ‘const void*’ to non-scalar type ‘cuFloatComplex’ requested
src/wrapper.cpp: At global scope:
src/wrapper.cpp:97: warning: unused parameter ‘Order’


Any hint to fis this? Sometime back, I could use this approach to work with scigpu. But now, with magma, it failed.

with thanks and regards
Bala
bala
 
Posts: 5
Joined: Fri Jul 29, 2011 3:37 am

Re: Magma compiling with MPF failed

Postby mgates3 » Wed May 02, 2012 4:27 pm

MAGMA does not replace the existing BLAS and LAPACK libraries on the CPU. It supplements them with functions to run on the GPU. In fact, MAGMA routines use both the existing BLAS on the CPU (e.g., ATLAS, MKL) and BLAS on the GPU (e.g., CUBLAS, MAGMABLAS).

Certainly you could write a wrapper to call magmablas_sgemm (or cublasSgemm), but such a wrapper would have to transfer data from the CPU to the GPU, perform the gemm, then transfer data back from the GPU to the CPU. These data transfers will severely diminish the performance. It is much better to re-write the code so the data resides on the GPU and call magmablas_sgemm directly.

Calls to higher level functions, such as zgetrf, can in many cases be directly replaced with calls to the MAGMA function, such as magma_zgetrf. However, we still use the existing LAPACK zgetrf within magma_zgetrf, so cannot replace it out-right.

As for errors with casts, you need to cast pointers (void*) to pointers (cuDoubleComplex*). But again, I recommend against writing a gemm wrapper that takes data on the CPU to perform the gemm on the GPU.

-mark
mgates3
 
Posts: 427
Joined: Fri Jan 06, 2012 2:13 pm

Re: Magma compiling with MPF failed

Postby fletchjp » Mon May 07, 2012 12:58 pm

I had some similar errors when attempting to build some of MAGMA 1.1.0 on Linux. This turned out to be because I was using a CUDA version which was newer than the version when I had built the magmablas library. The solution was to rebuild the library with a consistent set of CUDA headers.

I hope this helps.

John
fletchjp
 
Posts: 175
Joined: Mon Dec 27, 2010 7:29 pm


Return to User discussion

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron