complex data type in CULA

General CULA Dense (LAPACK & BLAS) support and troubleshooting. Use this forum if you are having a general problem or have encountered a bug.

complex data type in CULA

Postby dandan » Sun Jul 03, 2011 11:29 pm

Hi,

I would like to know if this is possible to force CULA to use C standard double complex data type instead of its own culaDoubleComplex? It is possible in Intel's MKL, although MKL has its own data type for complex numbers which is similar to CULA, but you can force MKL to use C complex instead of it's own. This is a very nice feature in MKL which reduces the porting effort of an already existing code. Is it also possible in CULA?

Regards,

D.
dandan
 
Posts: 16
Joined: Sat Feb 26, 2011 7:30 am

Re: complex data type in CULA

Postby john » Tue Jul 05, 2011 5:27 am

Are you asking about C99 complex or std::complex? For std::complex you can use it with CULA using C-style casts, like this:
Code: Select all
#include <complex>
#include <vector>
#include "cula.h"

int main()
{
    int n = 2048;
    std::vector<std::complex<float> > matrix(2048*2048);
    culaCgeTransposeInplace(n, (culaFloatComplex*)(&matrix[0]), n);
    return 0;
}


The CULA complex doesn't ask for much more than data alignment and that the data be in the array in RCRCRC layout, so in practice you can swap the complex type pretty easily.
john
Administrator
 
Posts: 587
Joined: Thu Jul 23, 2009 2:31 pm

Re: complex data type in CULA

Postby dandan » Wed Jul 13, 2011 8:44 am

Thanks. That was what I was looking for. The type-casting solved my problem.
dandan
 
Posts: 16
Joined: Sat Feb 26, 2011 7:30 am


Return to CULA Dense Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron