- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I've got a problem in calling vzCIS from C++
#include <complex>
#include "mkl.h"
template<class T>class array{
public:
int n;
T* x;
array(){};
~array(){};
array(int _n):n(_n),x(new T
};
int main(){
int n=32;
array<double> x(n);
array<double> y(n);
//array<MKL_Complex16> u(n);
//array<MKL_Complex16> v(n);
array< std::complex<double> > u(n);
array< std::complex<double> > v(n);
vdCos(x.n,x.x,y.x);
vzCIS(u.n,u.x,v.x);
return 0;
}
I compiled with icpc -mkl file.cpp and icpc gave me
error: argument of type "std::complex<double> *" is incompatible with parameter of type "MKL_Complex16 *"
Does someone have a solution? Tahnk you very much.
Fabio
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The third argument of vzCIS should be an array with type (Fortran's) DOUBLE COMPLEX or something compatible with it. Your code is trying to pass a real array instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MKL_Complex16 is compatible with std::complex<double>
and the version with comment out lines, i.e. array<MKL_Complex16>, does not work too. (with or without redefining MKL_Complex16).
mecej4: thank you now I've understand where is the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please, also have a look at the paper http://software.intel.com/en-us/articles/use-of-intel-mkl-data-types-in-cc-applications which describes some aspects of use of Intel(R) MKL data types in C++ applications. Thanks, Andrey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page