Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Sunny_Beast
Beginner
74 Views

problem with cblas_zgemm

Jump to solution
Dear service provider

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< cout << C[1].real << "+" << C[1].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

0 Kudos
1 Solution
mecej4
Black Belt
74 Views
What are the sizes of your matrices?

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.

View solution in original post

1 Reply
mecej4
Black Belt
75 Views
What are the sizes of your matrices?

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.

View solution in original post

Reply