- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I am trying MKL 10.3 provided with c++ composer xe for mac.

I was trying this simple code : for C = I*A;

???? but getting C as all zeros

#include

#include

using namespace std;

int main () {

MKL_Complex16 A[2], I[4], C[2], alpha, beta;

I[0].real = 1.0;I[0].imag = 1.0;

I[1].real = 1.0;I[1].imag = 1.0;

I[2].real = 1.0;I[2].imag = 1.0;

I[3].real = 1.0;I[3].imag = 1.0;

A[0].real = 10.0;A[0].imag = 1.0;

A[1].real = 11.0;A[1].imag = 11.0;

alpha.real = 1.0; alpha.imag = 0.0;

beta.real = 0.0; beta.imag = 0.0;

cblas_zgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, 2, 2, 1, α, I, 2, A, 2, β, C, 2);

cout << C[0].real << "+" << C[0].imag<

return 0;

}

// its a cpp file

build it with:

icpc main.cpp -o results_t -static-intel -DMKL_ILP64 -m64 /Developer/opt/intel/composerxe-2011.4.184/mkl/lib/libmkl_intel_ilp64.a /Developer/opt/intel/composerxe-2011.4.184/mkl/lib/libmkl_intel_thread.a /Developer/opt/intel/composerxe-2011.4.184/mkl/lib/libmkl_core.a /Developer/opt/intel/composerxe-2011.4.184/compiler/lib/libiomp5.a -lpthread

//results are

0+0

0+0

1 Solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

From the call to cblas_zgemm one would conclude from the values given for the arguments m, n and k that matrix I is of size 2 X 1 and A is of size 1 X 2. But that would make the product I.A of size 2 X 2. However, the apparent size of matrix C is different. This discrepancy needs to be resolved.

Link Copied

1 Reply

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

From the call to cblas_zgemm one would conclude from the values given for the arguments m, n and k that matrix I is of size 2 X 1 and A is of size 1 X 2. But that would make the product I.A of size 2 X 2. However, the apparent size of matrix C is different. This discrepancy needs to be resolved.

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page