<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Re:cblas_zgemm not producing correct results in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1347835#M32522</link>
    <description>Thank you for all your help and collaboration. I appreciate it</description>
    <pubDate>Sat, 01 Jan 2022 00:00:46 GMT</pubDate>
    <dc:creator>jeff222</dc:creator>
    <dc:date>2022-01-01T00:00:46Z</dc:date>
    <item>
      <title>cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1337179#M32302</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to run cblas_zgemm() to multiply a 3X1 by a 1X3 matrix to create a 3X3 matrix.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using C Unit Test I compiled and ran my software on a 64 bit machine&lt;/P&gt;
&lt;P&gt;Not sure what went wrong i believe i followed the example code exactly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help on what might be going wrong will be appreciated&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have included below&lt;/P&gt;
&lt;P&gt;- source code of cblas_zgemm()&lt;/P&gt;
&lt;P&gt;- test code using CUnit Test&lt;/P&gt;
&lt;P&gt;- Output&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Example Source Code:&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;void mkl_matrixMultiply(vector *result, vector *operand1, int op1_row, int op1_col, int trans1, vector *operand2, int op2_row, int op2_col, int trans2, int order)&lt;BR /&gt;{&lt;BR /&gt;/*Looping Index */&lt;BR /&gt;int i;&lt;BR /&gt;&lt;BR /&gt;MKL_INT m,n,k, lda, ldb, ldc;&lt;BR /&gt;MKL_Complex16 alpha, beta;&lt;BR /&gt;/*Matrix Declaration*/&lt;BR /&gt;MKL_Complex16 *a, *b, *c;&lt;BR /&gt;&lt;BR /&gt;CBLAS_ORDER cblas_order;&lt;BR /&gt;CBLAS_TRANSPOSE transA, transB;&lt;BR /&gt;&lt;BR /&gt;/*matrixC = alpha*matrixA*matrixB */ &lt;BR /&gt;a = (MKL_Complex16*)malloc(sizeof(MKL_Complex16));&lt;BR /&gt;b = (MKL_Complex16*)malloc(sizeof(MKL_Complex16)); &lt;BR /&gt;c = (MKL_Complex16*)malloc(sizeof(MKL_Complex16)); &lt;BR /&gt;&lt;BR /&gt;/*SCALAR */ &lt;BR /&gt;alpha.real = 1.0;&lt;BR /&gt;alpha.imag = 1.0;&lt;BR /&gt;beta.real = 1.0;&lt;BR /&gt;beta.imag = 1.0;&lt;BR /&gt;&lt;BR /&gt;/*Transpose*/ &lt;BR /&gt;if(trans1 == 0) &lt;BR /&gt;{&lt;BR /&gt;transA = CblasNoTrans;&lt;BR /&gt;}&lt;BR /&gt;else &lt;BR /&gt;{&lt;BR /&gt;transA = CblasTrans;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if(trans2 == 0) &lt;BR /&gt;{&lt;BR /&gt;transB = CblasNoTrans;&lt;BR /&gt;}&lt;BR /&gt;else &lt;BR /&gt;{&lt;BR /&gt;transB = CblasTrans;&lt;BR /&gt;}&lt;BR /&gt;/*Organization of data */&lt;BR /&gt;if(order == 0)&lt;BR /&gt;{&lt;BR /&gt;cblas_order = CblasColMajor; &lt;BR /&gt;}&lt;BR /&gt;else &lt;BR /&gt;{&lt;BR /&gt;cblas_order = CblasRowMajor; &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;m = op1_row; /* Matrix A row */&lt;BR /&gt;n = op2_col; /* Matrix B Column */&lt;BR /&gt;k = op1_col; /* Matrix B Row, Matrix A Column */&lt;BR /&gt;&lt;BR /&gt;lda = 1;&lt;BR /&gt;ldb = 1;&lt;BR /&gt;ldc = 1;&lt;/P&gt;
&lt;P&gt;/* Convert the vector arrays into complext_type arrays of data for Win32 library calls. */&lt;BR /&gt;/* Add the vector input values into a temporary complex array. */&lt;BR /&gt;for (i = 0; i &amp;lt; k; i++)&lt;BR /&gt;{&lt;BR /&gt;/* A = M x K */&lt;BR /&gt;a[i].real = operand1-&amp;gt;real[i];&lt;BR /&gt;a[i].imag = operand1-&amp;gt;imag[i];&lt;BR /&gt;&lt;BR /&gt;/* B = K X N */&lt;BR /&gt;b[i].real = operand2-&amp;gt;real[i];&lt;BR /&gt;b[i].imag = operand2-&amp;gt;imag[i]; &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;cblas_zgemm(cblas_order, transA, transB, m, n, k, &amp;amp;alpha,&lt;BR /&gt;a, lda, b, ldb, &amp;amp;beta, c, ldc);&lt;BR /&gt;&lt;BR /&gt;for( i = 0; i &amp;lt; 9; i++ )&lt;BR /&gt;{&lt;BR /&gt;result-&amp;gt;real[i] = c[i].real; &lt;BR /&gt;result-&amp;gt;imag[i] = c[i].imag;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;free(a);&lt;BR /&gt;free(b);&lt;BR /&gt;free(c); &lt;BR /&gt;}/* end of mkl_matrixMultiply */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Test Code:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;static void test_mkl_matrixMultiply(void)&lt;BR /&gt;{&lt;BR /&gt;#define s_Row 3 &lt;BR /&gt;#define s_Col 1 &lt;BR /&gt;#define t_Row 3 &lt;BR /&gt;#define t_Col 1&lt;BR /&gt;&lt;BR /&gt;int op1_col = s_Col; &lt;BR /&gt;int op1_row = s_Row;&lt;BR /&gt;int trans1 = 0;&lt;BR /&gt;&lt;BR /&gt;int op2_row = t_Row;&lt;BR /&gt;int op2_col = t_Col; &lt;BR /&gt;int trans2 = 1;&lt;BR /&gt;&lt;BR /&gt;vector *s = vnewz(3);&lt;BR /&gt;vector *t = vnewz(3); &lt;BR /&gt;vector *r = vnewz(9);&lt;BR /&gt;&lt;BR /&gt;float treal[3] = {&lt;BR /&gt;15.9840, 8.1929, 9.3919};&lt;/P&gt;
&lt;P&gt;float timag[3] = {&lt;BR /&gt;1.5051, 4.9810, 3.9310};&lt;BR /&gt;&lt;BR /&gt;float sreal[3] = {&lt;BR /&gt;15.9840, 8.1929, 9.3919};&lt;/P&gt;
&lt;P&gt;float simag[3] = {&lt;BR /&gt;1.5051, 4.9810, 3.9310}; &lt;BR /&gt;&lt;BR /&gt;float result_real[9] = {253.22, 123.46, 144.20, 123.46, 42.31, 57.37, 144.20, 57.37, 72.76};&lt;BR /&gt;float result_imag[9] = {48.12, 91.95, 76.97, 91.95, 81.26, 78.99, 76.97, 78.99, 73.84};&lt;/P&gt;
&lt;P&gt;int i;&lt;/P&gt;
&lt;P&gt;if ((NULL == r) || (NULL == s) ||(NULL == t) )&lt;BR /&gt;{&lt;BR /&gt;printf("Failed to locate vectors. Test discarded\n");&lt;BR /&gt;if (r)&lt;BR /&gt;{&lt;BR /&gt;vfree(r);&lt;BR /&gt;}&lt;BR /&gt;if (s)&lt;BR /&gt;{&lt;BR /&gt;vfree(s);&lt;BR /&gt;}&lt;BR /&gt;if (t)&lt;BR /&gt;{&lt;BR /&gt;vfree(t);&lt;BR /&gt;} &lt;BR /&gt;return;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;for ( i = 0; i &amp;lt; 3; i++)&lt;BR /&gt;{&lt;BR /&gt;s-&amp;gt;real[i] = sreal[i];&lt;BR /&gt;s-&amp;gt;imag[i] = simag[i];&lt;BR /&gt;&lt;BR /&gt;t-&amp;gt;real[i] = treal[i];&lt;BR /&gt;t-&amp;gt;imag[i] = timag[i]; &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;/* column Major*/&lt;BR /&gt;int order = 0;&lt;BR /&gt;&lt;BR /&gt;mkl_matrixMultiply(r, s, op1_row, op1_col, trans1, t, op2_row, op2_col, trans2, order); /* USES INTEL MKL */&lt;BR /&gt;&lt;BR /&gt;for (i = 0; i &amp;lt; 9; i++)&lt;BR /&gt;{&lt;BR /&gt;result_real[i] *= 0.001;&lt;BR /&gt;result_imag[i] *= 0.001;&lt;BR /&gt;CU_ASSERT(fabs(result_real[i] - r-&amp;gt;real[i]) &amp;lt; 0.0005);&lt;BR /&gt;CU_ASSERT(fabs(result_imag[i] - r-&amp;gt;imag[i]) &amp;lt; 0.0005);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;#if 1 /*def V_LIB_TST_VERBOSE*/&lt;BR /&gt;printf("\n");&lt;BR /&gt;for (i = 0; i &amp;lt; 9; i++)&lt;BR /&gt;{&lt;BR /&gt;printf("\t%d: r-&amp;gt;real = %f - rreal= %f\n", i, r-&amp;gt;real[i], result_real[i]);&lt;BR /&gt;printf("\t r-&amp;gt;imag = %f - rimag = %f\n", r-&amp;gt;imag[i], result_imag[i]);&lt;BR /&gt;}&lt;BR /&gt;#endif&lt;/P&gt;
&lt;P&gt;if (r)&lt;BR /&gt;{&lt;BR /&gt;vfree(r);&lt;BR /&gt;}&lt;BR /&gt;if (s)&lt;BR /&gt;{&lt;BR /&gt;vfree(s);&lt;BR /&gt;}&lt;BR /&gt;if (t)&lt;BR /&gt;{&lt;BR /&gt;vfree(t);&lt;BR /&gt;} &lt;BR /&gt;return;&lt;/P&gt;
&lt;P&gt;} /* test_mkl_matrixMultiply */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Output&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;r-&amp;gt;real is the output from cblas_zgemm&amp;nbsp;&lt;/P&gt;
&lt;P&gt;rreal is output from matlab&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Test: mkl_matrixMultiply ...&lt;BR /&gt;0: r-&amp;gt;real = 205.107895 - rreal= 0.253220&lt;BR /&gt;r-&amp;gt;imag = 301.337982 - rimag = 0.048120&lt;BR /&gt;1: r-&amp;gt;real = 0.000000 - rreal= 0.123460&lt;BR /&gt;r-&amp;gt;imag = 0.000000 - rimag = 0.091950&lt;BR /&gt;2: r-&amp;gt;real = 0.000000 - rreal= 0.144200&lt;BR /&gt;r-&amp;gt;imag = 0.000000 - rimag = 0.076970&lt;BR /&gt;3: r-&amp;gt;real = 0.000000 - rreal= 0.123460&lt;BR /&gt;r-&amp;gt;imag = 0.000000 - rimag = 0.091950&lt;BR /&gt;4: r-&amp;gt;real = 0.000000 - rreal= 0.042310&lt;BR /&gt;r-&amp;gt;imag = 0.000000 - rimag = 0.081260&lt;BR /&gt;5: r-&amp;gt;real = 0.000000 - rreal= 0.057370&lt;BR /&gt;r-&amp;gt;imag = 0.000000 - rimag = 0.078990&lt;BR /&gt;6: r-&amp;gt;real = 0.000000 - rreal= 0.144200&lt;BR /&gt;r-&amp;gt;imag = 0.000000 - rimag = 0.076970&lt;BR /&gt;7: r-&amp;gt;real = 0.000000 - rreal= 0.057370&lt;BR /&gt;r-&amp;gt;imag = 0.000000 - rimag = 0.078990&lt;BR /&gt;8: r-&amp;gt;real = 0.000000 - rreal= 0.072760&lt;BR /&gt;r-&amp;gt;imag = 0.000000 - rimag = 0.073840&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 02:42:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1337179#M32302</guid>
      <dc:creator>jeff222</dc:creator>
      <dc:date>2021-11-18T02:42:51Z</dc:date>
    </item>
    <item>
      <title>Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1337267#M32305</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for posting in intel communities. We would like to request you to share the complete sample reproducer, so that we could investigate your issue further.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Shanmukh.SS&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Nov 2021 11:30:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1337267#M32305</guid>
      <dc:creator>ShanmukhS_Intel</dc:creator>
      <dc:date>2021-11-18T11:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1338423#M32327</link>
      <description>&lt;P&gt;hi shanmukh,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure what you are looking for could you elaborate on what you need from me?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 00:47:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1338423#M32327</guid>
      <dc:creator>jeff222</dc:creator>
      <dc:date>2021-11-23T00:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1339165#M32337</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We will try reproducing the issue at our end. To perform the cblas_zgemm calculations, we need a sample reproducer. Could you please share us the sample working reproducer and the steps to reproduce, so that we could look into your issue further.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Shanmukh.SS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 08:55:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1339165#M32337</guid>
      <dc:creator>ShanmukhS_Intel</dc:creator>
      <dc:date>2022-01-03T08:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340049#M32351</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you mean by reproducer? does that mean source code,&lt;/P&gt;
&lt;P&gt;I am going to explain what I am trying to achieve to the best of my ability. And have shown my source code below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since posting my question I have had a little bit more success. I am trying to multiply op(a) * op(b)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;op(a) = { 83 + 10i,&amp;nbsp; 31 + 30i, 23 + 4i}&amp;nbsp; &amp;nbsp;row 3 (m) col 1 (k)&lt;/P&gt;
&lt;P&gt;op(b) = {83 - 10i, 31 - 30i,&amp;nbsp; 23 - 4i}&amp;nbsp; &amp;nbsp; &amp;nbsp; row 1 (k) col 3 (n)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the resultant vector from cblas_zgemm&lt;/P&gt;
&lt;P&gt;6989 + 6989i, 693&amp;nbsp; &amp;nbsp;+ 5053i, 1847 + 2051i,&lt;/P&gt;
&lt;P&gt;5053 + 693i,&amp;nbsp; &amp;nbsp;1861 + 1861i, 1399 + 267i,&lt;/P&gt;
&lt;P&gt;2051 + 1847i, 267&amp;nbsp; &amp;nbsp;+ 1399i,&amp;nbsp; 545 + 545i&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Matlab results of same multiplication&lt;/P&gt;
&lt;P&gt;6989 + 0000i, 2873&amp;nbsp; &amp;nbsp;- 2180i,&amp;nbsp; 1949 - 102i&lt;BR /&gt;2873 + 2180i, 1861 +&amp;nbsp; 0000i,&amp;nbsp; &amp;nbsp;833&amp;nbsp; + 566i&lt;BR /&gt;1949 + 102i,&amp;nbsp; &amp;nbsp; 833&amp;nbsp; &amp;nbsp;-&amp;nbsp; &amp;nbsp;566i,&amp;nbsp; &amp;nbsp; &amp;nbsp; 545 + 0000i&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Seems like the diagonal matrix is being calculated correctly minus the imaginary part not being 0.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have included the source code below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be greatly appreciated&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&amp;nbsp;&lt;BR /&gt;Jeff&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Source code of calling&amp;nbsp;&lt;/P&gt;
&lt;P&gt;void mkl_matrixMultiply(vector *result, vector *operand1, int op1_row, int op1_col, int trans1, vector *operand2, int op2_row, int op2_col, int trans2, int order)&lt;BR /&gt;{&lt;BR /&gt;/*Looping Index */&lt;BR /&gt;int i;&lt;BR /&gt;&lt;BR /&gt;MKL_INT m,n,k, lda, ldb, ldc;&lt;BR /&gt;MKL_Complex16 alpha, beta;&lt;BR /&gt;MKL_INT rmaxa, cmaxa, rmaxb, cmaxb, rmaxc, cmaxc;&lt;/P&gt;
&lt;P&gt;/*Matrix Declaration*/&lt;BR /&gt;MKL_Complex16 *a, *b, *c; &lt;BR /&gt;&lt;BR /&gt;/*Column_Major || Row_Major*/ &lt;BR /&gt;CBLAS_LAYOUT layout;&lt;BR /&gt;CBLAS_TRANSPOSE transA, transB;&lt;/P&gt;
&lt;P&gt;/*SCALAR */ &lt;BR /&gt;alpha.real = 1.0;&lt;BR /&gt;alpha.imag = 1.0;&lt;/P&gt;
&lt;P&gt;beta.real = 0.0;&lt;BR /&gt;beta.imag = 0.0;&lt;/P&gt;
&lt;P&gt;m = 3; /* Matrix A row */&lt;BR /&gt;n = 3; /* Matrix B Column */&lt;BR /&gt;k = 1; /* Matrix B Row, Matrix A Column */&lt;BR /&gt;&lt;BR /&gt;transA = CblasNoTrans;&lt;BR /&gt;transB = CblasNoTrans;&lt;/P&gt;
&lt;P&gt;layout = CblasRowMajor;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;if( transA == CblasNoTrans ) &lt;BR /&gt;{&lt;BR /&gt;rmaxa = m + 1;&lt;BR /&gt;cmaxa = k;&lt;BR /&gt;} &lt;BR /&gt;else &lt;BR /&gt;{&lt;BR /&gt;rmaxa = k + 1;&lt;BR /&gt;cmaxa = m;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;if( transB == CblasNoTrans ) &lt;BR /&gt;{&lt;BR /&gt;rmaxb = k + 1;&lt;BR /&gt;cmaxb = n;&lt;BR /&gt;} &lt;BR /&gt;else &lt;BR /&gt;{&lt;BR /&gt;rmaxb = n + 1;&lt;BR /&gt;cmaxb = k;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;rmaxc = m + 1;&lt;BR /&gt;cmaxc = n;&lt;/P&gt;
&lt;P&gt;if( layout == CblasRowMajor ) &lt;BR /&gt;{&lt;BR /&gt;lda=cmaxa;&lt;BR /&gt;ldb=cmaxb;&lt;BR /&gt;ldc=cmaxc;&lt;BR /&gt;} &lt;BR /&gt;else &lt;BR /&gt;{&lt;BR /&gt;lda=rmaxa;&lt;BR /&gt;ldb=rmaxb;&lt;BR /&gt;ldc=rmaxc;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;/*matrixC = alpha*matrixA*matrixB */ &lt;BR /&gt;a = (MKL_Complex16*)mkl_calloc(rmaxa*cmaxa,(sizeof(MKL_Complex16)),64);&lt;BR /&gt;b = (MKL_Complex16*)mkl_calloc(rmaxb*cmaxb,(sizeof(MKL_Complex16)),64);&lt;BR /&gt;c = (MKL_Complex16*)mkl_calloc(rmaxc*cmaxc,(sizeof(MKL_Complex16)),64);&lt;/P&gt;
&lt;P&gt;/* Convert the vector arrays into complext_type arrays of data for Win32 library calls. */&lt;BR /&gt;/* Add the vector input values into a temporary complex array. */&lt;BR /&gt;for (i = 0; i &amp;lt; 3; i++)&lt;BR /&gt;{&lt;BR /&gt;/* A = M x K */&lt;BR /&gt;a[i].real = operand1-&amp;gt;real[i];&lt;BR /&gt;a[i].imag = operand1-&amp;gt;imag[i];&lt;BR /&gt;&lt;BR /&gt;/* B = K X N */&lt;BR /&gt;b[i].real = operand2-&amp;gt;real[i];&lt;BR /&gt;b[i].imag = operand2-&amp;gt;imag[i]; &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;cblas_zgemm(layout, transA, transB, m, n, k, &amp;amp;alpha,&lt;BR /&gt;a, lda, b, ldb, &amp;amp;beta, c, ldc);&lt;BR /&gt;&lt;BR /&gt;for( i = 0; i &amp;lt; 9; i++ )&lt;BR /&gt;{&lt;BR /&gt;result-&amp;gt;real[i] = c[i].real; &lt;BR /&gt;result-&amp;gt;imag[i] = c[i].imag;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;mkl_free(a);&lt;BR /&gt;mkl_free(b);&lt;BR /&gt;mkl_free(c);&lt;/P&gt;
&lt;P&gt;} /* end of mkl_matrixMultiply */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 00:07:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340049#M32351</guid>
      <dc:creator>jeff222</dc:creator>
      <dc:date>2021-11-30T00:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340057#M32352</link>
      <description>&lt;P&gt;Currently Using 2018 version of intel MKL&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 00:57:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340057#M32352</guid>
      <dc:creator>jeff222</dc:creator>
      <dc:date>2021-11-30T00:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340058#M32353</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure what you mean by reproducer i am sorry.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you could kindly inform me what information you need i can give you the answers to the best of my ability&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will try and best describe what i am trying to accomplish as well as show the matlab results v cblas_zgemm results&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using 2018 MKL library&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since posting my question I have had a little bit more success. I am trying to multiply op(a) * op(b)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;op(a)&lt;/STRONG&gt; = { 83 + 10i,&amp;nbsp; 31 + 30i, 23 + 4i}&amp;nbsp; &amp;nbsp;row 3 (m) col 1 (k)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;op(b)&lt;/STRONG&gt; = {83 - 10i, 31 - 30i,&amp;nbsp; 23 - 4i}&amp;nbsp; &amp;nbsp; &amp;nbsp; row 1 (k) col 3 (n)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;the resultant vector from cblas_zgemm&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;6989 + 6989i, 693&amp;nbsp; &amp;nbsp;+ 5053i, 1847 + 2051i,&lt;/P&gt;
&lt;P&gt;5053 + 693i,&amp;nbsp; &amp;nbsp;1861 + 1861i, 1399 + 267i,&lt;/P&gt;
&lt;P&gt;2051 + 1847i, 267&amp;nbsp; &amp;nbsp;+ 1399i,&amp;nbsp; 545 + 545i&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Matlab results of same multiplication&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;6989 + 0000i, 2873&amp;nbsp; &amp;nbsp;- 2180i,&amp;nbsp; 1949 - 102i&lt;BR /&gt;2873 + 2180i, 1861 +&amp;nbsp; 0000i,&amp;nbsp; &amp;nbsp;833&amp;nbsp; + 566i&lt;BR /&gt;1949 + 102i,&amp;nbsp; &amp;nbsp; 833&amp;nbsp; &amp;nbsp;-&amp;nbsp; &amp;nbsp;566i,&amp;nbsp; &amp;nbsp; &amp;nbsp; 545 + 0000i&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Seems like the diagonal matrix is being calculated correctly minus the imaginary not being 0 for the diagonal.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Source code of calling&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;void mkl_matrixMultiply(vector *result, vector *operand1, int op1_row, int op1_col, int trans1, vector *operand2, int op2_row, int op2_col, int trans2, int order)&lt;BR /&gt;{&lt;BR /&gt;/*Looping Index */&lt;BR /&gt;int i;&lt;/P&gt;
&lt;P&gt;MKL_INT m,n,k, lda, ldb, ldc;&lt;BR /&gt;MKL_Complex16 alpha, beta;&lt;BR /&gt;MKL_INT rmaxa, cmaxa, rmaxb, cmaxb, rmaxc, cmaxc;&lt;/P&gt;
&lt;P&gt;/*Matrix Declaration*/&lt;BR /&gt;MKL_Complex16 *a, *b, *c;&lt;/P&gt;
&lt;P&gt;/*Column_Major || Row_Major*/&lt;BR /&gt;CBLAS_LAYOUT layout;&lt;BR /&gt;CBLAS_TRANSPOSE transA, transB;&lt;/P&gt;
&lt;P&gt;/*SCALAR */&lt;BR /&gt;alpha.real = 1.0;&lt;BR /&gt;alpha.imag = 1.0;&lt;/P&gt;
&lt;P&gt;beta.real = 0.0;&lt;BR /&gt;beta.imag = 0.0;&lt;/P&gt;
&lt;P&gt;m = 3; /* Matrix A row */&lt;BR /&gt;n = 3; /* Matrix B Column */&lt;BR /&gt;k = 1; /* Matrix B Row, Matrix A Column */&lt;/P&gt;
&lt;P&gt;transA = CblasNoTrans;&lt;BR /&gt;transB = CblasNoTrans;&lt;/P&gt;
&lt;P&gt;layout = CblasRowMajor;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;if( transA == CblasNoTrans )&lt;BR /&gt;{&lt;BR /&gt;rmaxa = m + 1;&lt;BR /&gt;cmaxa = k;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;rmaxa = k + 1;&lt;BR /&gt;cmaxa = m;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;if( transB == CblasNoTrans )&lt;BR /&gt;{&lt;BR /&gt;rmaxb = k + 1;&lt;BR /&gt;cmaxb = n;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;rmaxb = n + 1;&lt;BR /&gt;cmaxb = k;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;rmaxc = m + 1;&lt;BR /&gt;cmaxc = n;&lt;/P&gt;
&lt;P&gt;if( layout == CblasRowMajor )&lt;BR /&gt;{&lt;BR /&gt;lda=cmaxa;&lt;BR /&gt;ldb=cmaxb;&lt;BR /&gt;ldc=cmaxc;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;lda=rmaxa;&lt;BR /&gt;ldb=rmaxb;&lt;BR /&gt;ldc=rmaxc;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;/*matrixC = alpha*matrixA*matrixB */&lt;BR /&gt;a = (MKL_Complex16*)mkl_calloc(rmaxa*cmaxa,(sizeof(MKL_Complex16)),64);&lt;BR /&gt;b = (MKL_Complex16*)mkl_calloc(rmaxb*cmaxb,(sizeof(MKL_Complex16)),64);&lt;BR /&gt;c = (MKL_Complex16*)mkl_calloc(rmaxc*cmaxc,(sizeof(MKL_Complex16)),64);&lt;/P&gt;
&lt;P&gt;/* Convert the vector arrays into complext_type arrays of data for Win32 library calls. */&lt;BR /&gt;/* Add the vector input values into a temporary complex array. */&lt;BR /&gt;for (i = 0; i &amp;lt; 3; i++)&lt;BR /&gt;{&lt;BR /&gt;/* A = M x K */&lt;BR /&gt;a[i].real = operand1-&amp;gt;real[i];&lt;BR /&gt;a[i].imag = operand1-&amp;gt;imag[i];&lt;/P&gt;
&lt;P&gt;/* B = K X N */&lt;BR /&gt;b[i].real = operand2-&amp;gt;real[i];&lt;BR /&gt;b[i].imag = operand2-&amp;gt;imag[i];&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;cblas_zgemm(layout, transA, transB, m, n, k, &amp;amp;alpha,&lt;BR /&gt;a, lda, b, ldb, &amp;amp;beta, c, ldc);&lt;/P&gt;
&lt;P&gt;for( i = 0; i &amp;lt; 9; i++ )&lt;BR /&gt;{&lt;BR /&gt;result-&amp;gt;real[i] = c[i].real;&lt;BR /&gt;result-&amp;gt;imag[i] = c[i].imag;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;mkl_free(a);&lt;BR /&gt;mkl_free(b);&lt;BR /&gt;mkl_free(c);&lt;/P&gt;
&lt;P&gt;} /* end of mkl_matrixMultiply */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 01:00:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340058#M32353</guid>
      <dc:creator>jeff222</dc:creator>
      <dc:date>2021-11-30T01:00:50Z</dc:date>
    </item>
    <item>
      <title>Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340570#M32372</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Could you please share us the sample reproducer (the complete source code which you are working on to perform the desired functionalities), the example code followed by you so that we could investigate the issue.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Shanmukh.SS&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Dec 2021 12:23:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340570#M32372</guid>
      <dc:creator>ShanmukhS_Intel</dc:creator>
      <dc:date>2021-12-01T12:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340617#M32374</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since posting my question I have had a little bit more success. I am trying to multiply op(a) * op(b)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;op(a) = { 83 + 10i,&amp;nbsp; 31 + 30i, 23 + 4i}&amp;nbsp; &amp;nbsp;row 3 (m) col 1 (k)&lt;/P&gt;
&lt;P&gt;op(b) = {83 - 10i, 31 - 30i,&amp;nbsp; 23 - 4i}&amp;nbsp; &amp;nbsp; &amp;nbsp; row 1 (k) col 3 (n)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the resultant vector from cblas_zgemm&lt;/P&gt;
&lt;P&gt;6989 + 0i, 693&amp;nbsp; &amp;nbsp;+ 5053i, 1847 + 2051i,&lt;/P&gt;
&lt;P&gt;5053 + 693i,&amp;nbsp;1861 + 0i, 1399 + 267i,&lt;/P&gt;
&lt;P&gt;2051 + 1847i, 267&amp;nbsp;+ 1399i,&amp;nbsp; 545 + 0i&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Matlab results of same multiplication&lt;/P&gt;
&lt;P&gt;6989 + 0000i, 2873&amp;nbsp; &amp;nbsp;- 2180i,&amp;nbsp; 1949 - 102i&lt;BR /&gt;2873 + 2180i, 1861 +&amp;nbsp; 0000i,&amp;nbsp; &amp;nbsp;833&amp;nbsp; + 566i&lt;BR /&gt;1949 + 102i,&amp;nbsp; 833&amp;nbsp; &amp;nbsp;-&amp;nbsp; &amp;nbsp;566i,&amp;nbsp; 545 + 0000i&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Seems like the diagonal matrix is being calculated correctly minus the imaginary not being 0 for the diagonal.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below I have shared the sample code from 2018 version&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeff&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;example source code&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;/*******************************************************************************&lt;BR /&gt;* Copyright 1999-2018 Intel Corporation.&lt;BR /&gt;*&lt;BR /&gt;* This software and the related documents are Intel copyrighted materials, and&lt;BR /&gt;* your use of them is governed by the express license under which they were&lt;BR /&gt;* provided to you (License). Unless the License provides otherwise, you may not&lt;BR /&gt;* use, modify, copy, publish, distribute, disclose or transmit this software or&lt;BR /&gt;* the related documents without Intel's prior written permission.&lt;BR /&gt;*&lt;BR /&gt;* This software and the related documents are provided as is, with no express&lt;BR /&gt;* or implied warranties, other than those that are expressly stated in the&lt;BR /&gt;* License.&lt;BR /&gt;*******************************************************************************/&lt;/P&gt;
&lt;P&gt;/*&lt;BR /&gt;! Content:&lt;BR /&gt;! C B L A S _ Z G E M M Example Program Text ( C Interface )&lt;BR /&gt;!******************************************************************************/&lt;/P&gt;
&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;#include "mkl.h"&lt;/P&gt;
&lt;P&gt;#include "mkl_example.h"&lt;/P&gt;
&lt;P&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;FILE *in_file;&lt;BR /&gt;char *in_file_name;&lt;/P&gt;
&lt;P&gt;MKL_INT m, n, k;&lt;BR /&gt;MKL_INT lda, ldb, ldc;&lt;BR /&gt;MKL_INT rmaxa, cmaxa, rmaxb, cmaxb, rmaxc, cmaxc;&lt;BR /&gt;MKL_Complex16 alpha, beta;&lt;BR /&gt;MKL_Complex16 *a, *b, *c;&lt;BR /&gt;CBLAS_LAYOUT layout;&lt;BR /&gt;CBLAS_TRANSPOSE transA, transB;&lt;BR /&gt;MKL_INT ma, na, mb, nb;&lt;/P&gt;
&lt;P&gt;printf("\n C B L A S _ Z G E M M EXAMPLE PROGRAM\n");&lt;/P&gt;
&lt;P&gt;/* Get input parameters */&lt;/P&gt;
&lt;P&gt;if( argc == 1 ) {&lt;BR /&gt;printf("\n You must specify in_file data file as 1-st parameter");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;in_file_name = argv[1];&lt;/P&gt;
&lt;P&gt;/* Get input data */&lt;/P&gt;
&lt;P&gt;if( (in_file = fopen( in_file_name, "r" )) == NULL ) {&lt;BR /&gt;printf("\n ERROR on OPEN '%s' with mode=\"r\"\n", in_file_name);&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetIntegerParameters(in_file, &amp;amp;m, &amp;amp;n, &amp;amp;k) != 3 ) {&lt;BR /&gt;printf("\n ERROR of m, n, k reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetScalarsZ(in_file, &amp;amp;alpha, &amp;amp;beta) != 2 ) {&lt;BR /&gt;printf("\n ERROR of alpha, beta reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetCblasCharParameters(in_file, &amp;amp;transA, &amp;amp;transB, &amp;amp;layout) != 3 ) {&lt;BR /&gt;printf("\n ERROR of transA, transB, layout reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;if( transA == CblasNoTrans ) {&lt;BR /&gt;rmaxa = m + 1;&lt;BR /&gt;cmaxa = k;&lt;BR /&gt;ma = m;&lt;BR /&gt;na = k;&lt;BR /&gt;} else {&lt;BR /&gt;rmaxa = k + 1;&lt;BR /&gt;cmaxa = m;&lt;BR /&gt;ma = k;&lt;BR /&gt;na = m;&lt;BR /&gt;}&lt;BR /&gt;if( transB == CblasNoTrans ) {&lt;BR /&gt;rmaxb = k + 1;&lt;BR /&gt;cmaxb = n;&lt;BR /&gt;mb = k;&lt;BR /&gt;nb = n;&lt;BR /&gt;} else {&lt;BR /&gt;rmaxb = n + 1;&lt;BR /&gt;cmaxb = k;&lt;BR /&gt;mb = n;&lt;BR /&gt;nb = k;&lt;BR /&gt;}&lt;BR /&gt;rmaxc = m + 1;&lt;BR /&gt;cmaxc = n;&lt;BR /&gt;a = (MKL_Complex16 *)mkl_calloc(rmaxa*cmaxa, sizeof(MKL_Complex16), 64);&lt;BR /&gt;b = (MKL_Complex16 *)mkl_calloc(rmaxb*cmaxb, sizeof(MKL_Complex16), 64);&lt;BR /&gt;c = (MKL_Complex16 *)mkl_calloc(rmaxc*cmaxc, sizeof(MKL_Complex16), 64);&lt;BR /&gt;if ( a == NULL || b == NULL || c == NULL ) {&lt;BR /&gt;printf("\n Can't allocate memory arrays");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( layout == CblasRowMajor ) {&lt;BR /&gt;lda=cmaxa;&lt;BR /&gt;ldb=cmaxb;&lt;BR /&gt;ldc=cmaxc;&lt;BR /&gt;} else {&lt;BR /&gt;lda=rmaxa;&lt;BR /&gt;ldb=rmaxb;&lt;BR /&gt;ldc=rmaxc;&lt;BR /&gt;}&lt;BR /&gt;if( GetArrayZ(in_file, &amp;amp;layout, GENERAL_MATRIX, &amp;amp;ma, &amp;amp;na, a, &amp;amp;lda) != 0 ) {&lt;BR /&gt;printf("\n ERROR of array A reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetArrayZ(in_file, &amp;amp;layout, GENERAL_MATRIX, &amp;amp;mb, &amp;amp;nb, b, &amp;amp;ldb) != 0 ) {&lt;BR /&gt;printf("\n ERROR of array B reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetArrayZ(in_file, &amp;amp;layout, GENERAL_MATRIX, &amp;amp;m, &amp;amp;n, c, &amp;amp;ldc) != 0 ) {&lt;BR /&gt;printf("\n ERROR of array C reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;fclose(in_file);&lt;/P&gt;
&lt;P&gt;/* Print input data */&lt;/P&gt;
&lt;P&gt;printf("\n INPUT DATA");&lt;BR /&gt;printf("\n M="INT_FORMAT" N="INT_FORMAT" K="INT_FORMAT, m, n, k);&lt;BR /&gt;printf("\n ALPHA =(%5.1f,%5.1f ) BETA =(%5.1f,%5.1f )",&lt;BR /&gt;alpha.real, alpha.imag, beta.real, beta.imag);&lt;BR /&gt;PrintParameters("TRANSA, TRANSB", transA, transB);&lt;BR /&gt;PrintParameters("LAYOUT", layout);&lt;BR /&gt;PrintArrayZ(&amp;amp;layout, FULLPRINT, GENERAL_MATRIX, &amp;amp;ma, &amp;amp;na, a, &amp;amp;lda, "A");&lt;BR /&gt;PrintArrayZ(&amp;amp;layout, FULLPRINT, GENERAL_MATRIX, &amp;amp;mb, &amp;amp;nb, b, &amp;amp;ldb, "B");&lt;BR /&gt;PrintArrayZ(&amp;amp;layout, FULLPRINT, GENERAL_MATRIX, &amp;amp;m, &amp;amp;n, c, &amp;amp;ldc, "C");&lt;/P&gt;
&lt;P&gt;/* Call ZGEMM subroutine ( C Interface ) */&lt;/P&gt;
&lt;P&gt;cblas_zgemm(layout, transA, transB, m, n, k, &amp;amp;alpha,&lt;BR /&gt;a, lda, b, ldb, &amp;amp;beta, c, ldc);&lt;/P&gt;
&lt;P&gt;/* Print output data */&lt;/P&gt;
&lt;P&gt;printf("\n\n OUTPUT DATA");&lt;BR /&gt;PrintArrayZ(&amp;amp;layout, FULLPRINT, GENERAL_MATRIX, &amp;amp;m, &amp;amp;n, c, &amp;amp;ldc, "C");&lt;/P&gt;
&lt;P&gt;mkl_free(a);&lt;BR /&gt;mkl_free(b);&lt;BR /&gt;mkl_free(c);&lt;/P&gt;
&lt;P&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Source code written by me&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;void mkl_matrixMultiply(vector *result, vector *operand1, int op1_row, int op1_col, int trans1, vector *operand2, int op2_row, int op2_col, int trans2, int order)&lt;BR /&gt;{&lt;BR /&gt;/*Looping Index */&lt;BR /&gt;int i;&lt;/P&gt;
&lt;P&gt;MKL_INT m,n,k, lda, ldb, ldc;&lt;BR /&gt;MKL_Complex16 alpha, beta;&lt;BR /&gt;MKL_INT rmaxa, cmaxa, rmaxb, cmaxb, rmaxc, cmaxc;&lt;/P&gt;
&lt;P&gt;/*Matrix Declaration*/&lt;BR /&gt;MKL_Complex16 *a, *b, *c;&lt;/P&gt;
&lt;P&gt;/*Column_Major || Row_Major*/&lt;BR /&gt;CBLAS_LAYOUT layout;&lt;BR /&gt;CBLAS_TRANSPOSE transA, transB;&lt;/P&gt;
&lt;P&gt;/*SCALAR */&lt;BR /&gt;alpha.real = 1.0;&lt;BR /&gt;alpha.imag = 1.0;&lt;/P&gt;
&lt;P&gt;beta.real = 0.0;&lt;BR /&gt;beta.imag = 0.0;&lt;/P&gt;
&lt;P&gt;m = 3; /* Matrix A row */&lt;BR /&gt;n = 3; /* Matrix B Column */&lt;BR /&gt;k = 1; /* Matrix B Row, Matrix A Column */&lt;/P&gt;
&lt;P&gt;transA = CblasNoTrans;&lt;BR /&gt;transB = CblasNoTrans;&lt;/P&gt;
&lt;P&gt;layout = CblasRowMajor;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;if( transA == CblasNoTrans )&lt;BR /&gt;{&lt;BR /&gt;rmaxa = m + 1;&lt;BR /&gt;cmaxa = k;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;rmaxa = k + 1;&lt;BR /&gt;cmaxa = m;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;if( transB == CblasNoTrans )&lt;BR /&gt;{&lt;BR /&gt;rmaxb = k + 1;&lt;BR /&gt;cmaxb = n;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;rmaxb = n + 1;&lt;BR /&gt;cmaxb = k;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;rmaxc = m + 1;&lt;BR /&gt;cmaxc = n;&lt;/P&gt;
&lt;P&gt;if( layout == CblasRowMajor )&lt;BR /&gt;{&lt;BR /&gt;lda=cmaxa;&lt;BR /&gt;ldb=cmaxb;&lt;BR /&gt;ldc=cmaxc;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;lda=rmaxa;&lt;BR /&gt;ldb=rmaxb;&lt;BR /&gt;ldc=rmaxc;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;/*matrixC = alpha*matrixA*matrixB */&lt;BR /&gt;a = (MKL_Complex16*)mkl_calloc(rmaxa*cmaxa,(sizeof(MKL_Complex16)),64);&lt;BR /&gt;b = (MKL_Complex16*)mkl_calloc(rmaxb*cmaxb,(sizeof(MKL_Complex16)),64);&lt;BR /&gt;c = (MKL_Complex16*)mkl_calloc(rmaxc*cmaxc,(sizeof(MKL_Complex16)),64);&lt;/P&gt;
&lt;P&gt;/* Convert the vector arrays into complext_type arrays of data for Win32 library calls. */&lt;BR /&gt;/* Add the vector input values into a temporary complex array. */&lt;BR /&gt;for (i = 0; i &amp;lt; 3; i++)&lt;BR /&gt;{&lt;BR /&gt;/* A = M x K */&lt;BR /&gt;a[i].real = operand1-&amp;gt;real[i];&lt;BR /&gt;a[i].imag = operand1-&amp;gt;imag[i];&lt;/P&gt;
&lt;P&gt;/* B = K X N */&lt;BR /&gt;b[i].real = operand2-&amp;gt;real[i];&lt;BR /&gt;b[i].imag = operand2-&amp;gt;imag[i];&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;cblas_zgemm(layout, transA, transB, m, n, k, &amp;amp;alpha,&lt;BR /&gt;a, lda, b, ldb, &amp;amp;beta, c, ldc);&lt;/P&gt;
&lt;P&gt;for( i = 0; i &amp;lt; 9; i++ )&lt;BR /&gt;{&lt;BR /&gt;result-&amp;gt;real[i] = c[i].real;&lt;BR /&gt;result-&amp;gt;imag[i] = c[i].imag;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;mkl_free(a);&lt;BR /&gt;mkl_free(b);&lt;BR /&gt;mkl_free(c);&lt;/P&gt;
&lt;P&gt;} /* end of mkl_matrixMultiply */&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 16:50:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340617#M32374</guid>
      <dc:creator>jeff222</dc:creator>
      <dc:date>2021-12-01T16:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340618#M32375</link>
      <description>&lt;P class="sub_section_element_selectors"&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;Since posting my question I have had a little bit more success. I am trying to multiply op(a) * op(b)&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;op(a) = { 83 + 10i,&amp;nbsp; 31 + 30i, 23 + 4i}&amp;nbsp; &amp;nbsp;row 3 (m) col 1 (k)&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;op(b) = {83 - 10i, 31 - 30i,&amp;nbsp; 23 - 4i}&amp;nbsp; &amp;nbsp; &amp;nbsp; row 1 (k) col 3 (n)&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;the resultant vector from cblas_zgemm&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;6989 + 0i, 693&amp;nbsp; &amp;nbsp;+ 5053i, 1847 + 2051i,&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;5053 + 693i,&amp;nbsp;1861 + 0i, 1399 + 267i,&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;2051 + 1847i, 267&amp;nbsp;+ 1399i,&amp;nbsp; 545 + 0i&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;Matlab results of same multiplication&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;6989 + 0000i, 2873&amp;nbsp; &amp;nbsp;- 2180i,&amp;nbsp; 1949 - 102i&lt;BR /&gt;2873 + 2180i, 1861 +&amp;nbsp; 0000i,&amp;nbsp; &amp;nbsp;833&amp;nbsp; + 566i&lt;BR /&gt;1949 + 102i,&amp;nbsp; 833&amp;nbsp; &amp;nbsp;-&amp;nbsp; &amp;nbsp;566i,&amp;nbsp; 545 + 0000i&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;Seems like the diagonal matrix is being calculated correctly minus the imaginary not being 0 for the diagonal.&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;Below I have shared the sample code from 2018 version&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;Thanks,&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;Jeff&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&lt;STRONG class="sub_section_element_selectors"&gt;example source code&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;/*******************************************************************************&lt;BR /&gt;* Copyright 1999-2018 Intel Corporation.&lt;BR /&gt;*&lt;BR /&gt;* This software and the related documents are Intel copyrighted materials, and&lt;BR /&gt;* your use of them is governed by the express license under which they were&lt;BR /&gt;* provided to you (License). Unless the License provides otherwise, you may not&lt;BR /&gt;* use, modify, copy, publish, distribute, disclose or transmit this software or&lt;BR /&gt;* the related documents without Intel's prior written permission.&lt;BR /&gt;*&lt;BR /&gt;* This software and the related documents are provided as is, with no express&lt;BR /&gt;* or implied warranties, other than those that are expressly stated in the&lt;BR /&gt;* License.&lt;BR /&gt;*******************************************************************************/&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;/*&lt;BR /&gt;! Content:&lt;BR /&gt;! C B L A S _ Z G E M M Example Program Text ( C Interface )&lt;BR /&gt;!******************************************************************************/&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;#include "mkl.h"&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;#include "mkl_example.h"&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;FILE *in_file;&lt;BR /&gt;char *in_file_name;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;MKL_INT m, n, k;&lt;BR /&gt;MKL_INT lda, ldb, ldc;&lt;BR /&gt;MKL_INT rmaxa, cmaxa, rmaxb, cmaxb, rmaxc, cmaxc;&lt;BR /&gt;MKL_Complex16 alpha, beta;&lt;BR /&gt;MKL_Complex16 *a, *b, *c;&lt;BR /&gt;CBLAS_LAYOUT layout;&lt;BR /&gt;CBLAS_TRANSPOSE transA, transB;&lt;BR /&gt;MKL_INT ma, na, mb, nb;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;printf("\n C B L A S _ Z G E M M EXAMPLE PROGRAM\n");&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;/* Get input parameters */&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;if( argc == 1 ) {&lt;BR /&gt;printf("\n You must specify in_file data file as 1-st parameter");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;in_file_name = argv[1];&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;/* Get input data */&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;if( (in_file = fopen( in_file_name, "r" )) == NULL ) {&lt;BR /&gt;printf("\n ERROR on OPEN '%s' with mode=\"r\"\n", in_file_name);&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetIntegerParameters(in_file, &amp;amp;m, &amp;amp;n, &amp;amp;k) != 3 ) {&lt;BR /&gt;printf("\n ERROR of m, n, k reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetScalarsZ(in_file, &amp;amp;alpha, &amp;amp;beta) != 2 ) {&lt;BR /&gt;printf("\n ERROR of alpha, beta reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetCblasCharParameters(in_file, &amp;amp;transA, &amp;amp;transB, &amp;amp;layout) != 3 ) {&lt;BR /&gt;printf("\n ERROR of transA, transB, layout reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;if( transA == CblasNoTrans ) {&lt;BR /&gt;rmaxa = m + 1;&lt;BR /&gt;cmaxa = k;&lt;BR /&gt;ma = m;&lt;BR /&gt;na = k;&lt;BR /&gt;} else {&lt;BR /&gt;rmaxa = k + 1;&lt;BR /&gt;cmaxa = m;&lt;BR /&gt;ma = k;&lt;BR /&gt;na = m;&lt;BR /&gt;}&lt;BR /&gt;if( transB == CblasNoTrans ) {&lt;BR /&gt;rmaxb = k + 1;&lt;BR /&gt;cmaxb = n;&lt;BR /&gt;mb = k;&lt;BR /&gt;nb = n;&lt;BR /&gt;} else {&lt;BR /&gt;rmaxb = n + 1;&lt;BR /&gt;cmaxb = k;&lt;BR /&gt;mb = n;&lt;BR /&gt;nb = k;&lt;BR /&gt;}&lt;BR /&gt;rmaxc = m + 1;&lt;BR /&gt;cmaxc = n;&lt;BR /&gt;a = (MKL_Complex16 *)mkl_calloc(rmaxa*cmaxa, sizeof(MKL_Complex16), 64);&lt;BR /&gt;b = (MKL_Complex16 *)mkl_calloc(rmaxb*cmaxb, sizeof(MKL_Complex16), 64);&lt;BR /&gt;c = (MKL_Complex16 *)mkl_calloc(rmaxc*cmaxc, sizeof(MKL_Complex16), 64);&lt;BR /&gt;if ( a == NULL || b == NULL || c == NULL ) {&lt;BR /&gt;printf("\n Can't allocate memory arrays");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( layout == CblasRowMajor ) {&lt;BR /&gt;lda=cmaxa;&lt;BR /&gt;ldb=cmaxb;&lt;BR /&gt;ldc=cmaxc;&lt;BR /&gt;} else {&lt;BR /&gt;lda=rmaxa;&lt;BR /&gt;ldb=rmaxb;&lt;BR /&gt;ldc=rmaxc;&lt;BR /&gt;}&lt;BR /&gt;if( GetArrayZ(in_file, &amp;amp;layout, GENERAL_MATRIX, &amp;amp;ma, &amp;amp;na, a, &amp;amp;lda) != 0 ) {&lt;BR /&gt;printf("\n ERROR of array A reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetArrayZ(in_file, &amp;amp;layout, GENERAL_MATRIX, &amp;amp;mb, &amp;amp;nb, b, &amp;amp;ldb) != 0 ) {&lt;BR /&gt;printf("\n ERROR of array B reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetArrayZ(in_file, &amp;amp;layout, GENERAL_MATRIX, &amp;amp;m, &amp;amp;n, c, &amp;amp;ldc) != 0 ) {&lt;BR /&gt;printf("\n ERROR of array C reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;fclose(in_file);&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;/* Print input data */&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;printf("\n INPUT DATA");&lt;BR /&gt;printf("\n M="INT_FORMAT" N="INT_FORMAT" K="INT_FORMAT, m, n, k);&lt;BR /&gt;printf("\n ALPHA =(%5.1f,%5.1f ) BETA =(%5.1f,%5.1f )",&lt;BR /&gt;alpha.real, alpha.imag, beta.real, beta.imag);&lt;BR /&gt;PrintParameters("TRANSA, TRANSB", transA, transB);&lt;BR /&gt;PrintParameters("LAYOUT", layout);&lt;BR /&gt;PrintArrayZ(&amp;amp;layout, FULLPRINT, GENERAL_MATRIX, &amp;amp;ma, &amp;amp;na, a, &amp;amp;lda, "A");&lt;BR /&gt;PrintArrayZ(&amp;amp;layout, FULLPRINT, GENERAL_MATRIX, &amp;amp;mb, &amp;amp;nb, b, &amp;amp;ldb, "B");&lt;BR /&gt;PrintArrayZ(&amp;amp;layout, FULLPRINT, GENERAL_MATRIX, &amp;amp;m, &amp;amp;n, c, &amp;amp;ldc, "C");&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;/* Call ZGEMM subroutine ( C Interface ) */&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;cblas_zgemm(layout, transA, transB, m, n, k, &amp;amp;alpha,&lt;BR /&gt;a, lda, b, ldb, &amp;amp;beta, c, ldc);&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;/* Print output data */&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;printf("\n\n OUTPUT DATA");&lt;BR /&gt;PrintArrayZ(&amp;amp;layout, FULLPRINT, GENERAL_MATRIX, &amp;amp;m, &amp;amp;n, c, &amp;amp;ldc, "C");&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;mkl_free(a);&lt;BR /&gt;mkl_free(b);&lt;BR /&gt;mkl_free(c);&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&lt;STRONG class="sub_section_element_selectors"&gt;Source code written by me&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;void mkl_matrixMultiply(vector *result, vector *operand1, int op1_row, int op1_col, int trans1, vector *operand2, int op2_row, int op2_col, int trans2, int order)&lt;BR /&gt;{&lt;BR /&gt;/*Looping Index */&lt;BR /&gt;int i;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;MKL_INT m,n,k, lda, ldb, ldc;&lt;BR /&gt;MKL_Complex16 alpha, beta;&lt;BR /&gt;MKL_INT rmaxa, cmaxa, rmaxb, cmaxb, rmaxc, cmaxc;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;/*Matrix Declaration*/&lt;BR /&gt;MKL_Complex16 *a, *b, *c;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;/*Column_Major || Row_Major*/&lt;BR /&gt;CBLAS_LAYOUT layout;&lt;BR /&gt;CBLAS_TRANSPOSE transA, transB;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;/*SCALAR */&lt;BR /&gt;alpha.real = 1.0;&lt;BR /&gt;alpha.imag = 1.0;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;beta.real = 0.0;&lt;BR /&gt;beta.imag = 0.0;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;m = 3; /* Matrix A row */&lt;BR /&gt;n = 3; /* Matrix B Column */&lt;BR /&gt;k = 1; /* Matrix B Row, Matrix A Column */&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;transA = CblasNoTrans;&lt;BR /&gt;transB = CblasNoTrans;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;layout = CblasRowMajor;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&lt;BR /&gt;if( transA == CblasNoTrans )&lt;BR /&gt;{&lt;BR /&gt;rmaxa = m + 1;&lt;BR /&gt;cmaxa = k;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;rmaxa = k + 1;&lt;BR /&gt;cmaxa = m;&lt;BR /&gt;}&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;if( transB == CblasNoTrans )&lt;BR /&gt;{&lt;BR /&gt;rmaxb = k + 1;&lt;BR /&gt;cmaxb = n;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;rmaxb = n + 1;&lt;BR /&gt;cmaxb = k;&lt;BR /&gt;}&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;rmaxc = m + 1;&lt;BR /&gt;cmaxc = n;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;if( layout == CblasRowMajor )&lt;BR /&gt;{&lt;BR /&gt;lda=cmaxa;&lt;BR /&gt;ldb=cmaxb;&lt;BR /&gt;ldc=cmaxc;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;lda=rmaxa;&lt;BR /&gt;ldb=rmaxb;&lt;BR /&gt;ldc=rmaxc;&lt;BR /&gt;}&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;/*matrixC = alpha*matrixA*matrixB */&lt;BR /&gt;a = (MKL_Complex16*)mkl_calloc(rmaxa*cmaxa,(sizeof(MKL_Complex16)),64);&lt;BR /&gt;b = (MKL_Complex16*)mkl_calloc(rmaxb*cmaxb,(sizeof(MKL_Complex16)),64);&lt;BR /&gt;c = (MKL_Complex16*)mkl_calloc(rmaxc*cmaxc,(sizeof(MKL_Complex16)),64);&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;/* Convert the vector arrays into complext_type arrays of data for Win32 library calls. */&lt;BR /&gt;/* Add the vector input values into a temporary complex array. */&lt;BR /&gt;for (i = 0; i &amp;lt; 3; i++)&lt;BR /&gt;{&lt;BR /&gt;/* A = M x K */&lt;BR /&gt;a[i].real = operand1-&amp;gt;real[i];&lt;BR /&gt;a[i].imag = operand1-&amp;gt;imag[i];&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;/* B = K X N */&lt;BR /&gt;b[i].real = operand2-&amp;gt;real[i];&lt;BR /&gt;b[i].imag = operand2-&amp;gt;imag[i];&lt;BR /&gt;}&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;cblas_zgemm(layout, transA, transB, m, n, k, &amp;amp;alpha,&lt;BR /&gt;a, lda, b, ldb, &amp;amp;beta, c, ldc);&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;for( i = 0; i &amp;lt; 9; i++ )&lt;BR /&gt;{&lt;BR /&gt;result-&amp;gt;real[i] = c[i].real;&lt;BR /&gt;result-&amp;gt;imag[i] = c[i].imag;&lt;BR /&gt;}&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;mkl_free(a);&lt;BR /&gt;mkl_free(b);&lt;BR /&gt;mkl_free(c);&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;} /* end of mkl_matrixMultiply */&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 16:51:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340618#M32375</guid>
      <dc:creator>jeff222</dc:creator>
      <dc:date>2021-12-01T16:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340710#M32376</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Since posting my question I have had a little bit more success. I am trying to multiply op(a) * op(b)&lt;/P&gt;
&lt;P&gt;op(a) = { 83 + 10i, 31 + 30i, 23 + 4i} row 3 (m) col 1 (k)&lt;/P&gt;
&lt;P&gt;op(b) = {83 - 10i, 31 - 30i, 23 - 4i} row 1 (k) col 3 (n)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the resultant vector from cblas_zgemm&lt;/P&gt;
&lt;P&gt;6989 + 0i, 693 + 5053i, 1847 + 2051i,&lt;/P&gt;
&lt;P&gt;5053 + 693i, 1861 + 0i, 1399 + 267i,&lt;/P&gt;
&lt;P&gt;2051 + 1847i, 267 + 1399i, 545 + 0i&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Matlab results of same multiplication&lt;/P&gt;
&lt;P&gt;6989 + 0000i, 2873 - 2180i, 1949 - 102i&lt;BR /&gt;2873 + 2180i, 1861 + 0000i, 833 + 566i&lt;BR /&gt;1949 + 102i, 833 - 566i, 545 + 0000i&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Seems like the diagonal matrix is being calculated correctly minus the imaginary not being 0 for the diagonal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below I have shared the sample code from 2018 version&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Jeff&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example source code&lt;/P&gt;
&lt;P&gt;/*******************************************************************************&lt;BR /&gt;* Copyright 1999-2018 Intel Corporation.&lt;BR /&gt;*&lt;BR /&gt;* This software and the related documents are Intel copyrighted materials, and&lt;BR /&gt;* your use of them is governed by the express license under which they were&lt;BR /&gt;* provided to you (License). Unless the License provides otherwise, you may not&lt;BR /&gt;* use, modify, copy, publish, distribute, disclose or transmit this software or&lt;BR /&gt;* the related documents without Intel's prior written permission.&lt;BR /&gt;*&lt;BR /&gt;* This software and the related documents are provided as is, with no express&lt;BR /&gt;* or implied warranties, other than those that are expressly stated in the&lt;BR /&gt;* License.&lt;BR /&gt;*******************************************************************************/&lt;/P&gt;
&lt;P&gt;/*&lt;BR /&gt;! Content:&lt;BR /&gt;! C B L A S _ Z G E M M Example Program Text ( C Interface )&lt;BR /&gt;!******************************************************************************/&lt;/P&gt;
&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;#include "mkl.h"&lt;/P&gt;
&lt;P&gt;#include "mkl_example.h"&lt;/P&gt;
&lt;P&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;FILE *in_file;&lt;BR /&gt;char *in_file_name;&lt;/P&gt;
&lt;P&gt;MKL_INT m, n, k;&lt;BR /&gt;MKL_INT lda, ldb, ldc;&lt;BR /&gt;MKL_INT rmaxa, cmaxa, rmaxb, cmaxb, rmaxc, cmaxc;&lt;BR /&gt;MKL_Complex16 alpha, beta;&lt;BR /&gt;MKL_Complex16 *a, *b, *c;&lt;BR /&gt;CBLAS_LAYOUT layout;&lt;BR /&gt;CBLAS_TRANSPOSE transA, transB;&lt;BR /&gt;MKL_INT ma, na, mb, nb;&lt;/P&gt;
&lt;P&gt;printf("\n C B L A S _ Z G E M M EXAMPLE PROGRAM\n");&lt;/P&gt;
&lt;P&gt;/* Get input parameters */&lt;/P&gt;
&lt;P&gt;if( argc == 1 ) {&lt;BR /&gt;printf("\n You must specify in_file data file as 1-st parameter");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;in_file_name = argv[1];&lt;/P&gt;
&lt;P&gt;/* Get input data */&lt;/P&gt;
&lt;P&gt;if( (in_file = fopen( in_file_name, "r" )) == NULL ) {&lt;BR /&gt;printf("\n ERROR on OPEN '%s' with mode=\"r\"\n", in_file_name);&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetIntegerParameters(in_file, &amp;amp;m, &amp;amp;n, &amp;amp;k) != 3 ) {&lt;BR /&gt;printf("\n ERROR of m, n, k reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetScalarsZ(in_file, &amp;amp;alpha, &amp;amp;beta) != 2 ) {&lt;BR /&gt;printf("\n ERROR of alpha, beta reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetCblasCharParameters(in_file, &amp;amp;transA, &amp;amp;transB, &amp;amp;layout) != 3 ) {&lt;BR /&gt;printf("\n ERROR of transA, transB, layout reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;if( transA == CblasNoTrans ) {&lt;BR /&gt;rmaxa = m + 1;&lt;BR /&gt;cmaxa = k;&lt;BR /&gt;ma = m;&lt;BR /&gt;na = k;&lt;BR /&gt;} else {&lt;BR /&gt;rmaxa = k + 1;&lt;BR /&gt;cmaxa = m;&lt;BR /&gt;ma = k;&lt;BR /&gt;na = m;&lt;BR /&gt;}&lt;BR /&gt;if( transB == CblasNoTrans ) {&lt;BR /&gt;rmaxb = k + 1;&lt;BR /&gt;cmaxb = n;&lt;BR /&gt;mb = k;&lt;BR /&gt;nb = n;&lt;BR /&gt;} else {&lt;BR /&gt;rmaxb = n + 1;&lt;BR /&gt;cmaxb = k;&lt;BR /&gt;mb = n;&lt;BR /&gt;nb = k;&lt;BR /&gt;}&lt;BR /&gt;rmaxc = m + 1;&lt;BR /&gt;cmaxc = n;&lt;BR /&gt;a = (MKL_Complex16 *)mkl_calloc(rmaxa*cmaxa, sizeof(MKL_Complex16), 64);&lt;BR /&gt;b = (MKL_Complex16 *)mkl_calloc(rmaxb*cmaxb, sizeof(MKL_Complex16), 64);&lt;BR /&gt;c = (MKL_Complex16 *)mkl_calloc(rmaxc*cmaxc, sizeof(MKL_Complex16), 64);&lt;BR /&gt;if ( a == NULL || b == NULL || c == NULL ) {&lt;BR /&gt;printf("\n Can't allocate memory arrays");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( layout == CblasRowMajor ) {&lt;BR /&gt;lda=cmaxa;&lt;BR /&gt;ldb=cmaxb;&lt;BR /&gt;ldc=cmaxc;&lt;BR /&gt;} else {&lt;BR /&gt;lda=rmaxa;&lt;BR /&gt;ldb=rmaxb;&lt;BR /&gt;ldc=rmaxc;&lt;BR /&gt;}&lt;BR /&gt;if( GetArrayZ(in_file, &amp;amp;layout, GENERAL_MATRIX, &amp;amp;ma, &amp;amp;na, a, &amp;amp;lda) != 0 ) {&lt;BR /&gt;printf("\n ERROR of array A reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetArrayZ(in_file, &amp;amp;layout, GENERAL_MATRIX, &amp;amp;mb, &amp;amp;nb, b, &amp;amp;ldb) != 0 ) {&lt;BR /&gt;printf("\n ERROR of array B reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;if( GetArrayZ(in_file, &amp;amp;layout, GENERAL_MATRIX, &amp;amp;m, &amp;amp;n, c, &amp;amp;ldc) != 0 ) {&lt;BR /&gt;printf("\n ERROR of array C reading\n");&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;BR /&gt;fclose(in_file);&lt;/P&gt;
&lt;P&gt;/* Print input data */&lt;/P&gt;
&lt;P&gt;printf("\n INPUT DATA");&lt;BR /&gt;printf("\n M="INT_FORMAT" N="INT_FORMAT" K="INT_FORMAT, m, n, k);&lt;BR /&gt;printf("\n ALPHA =(%5.1f,%5.1f ) BETA =(%5.1f,%5.1f )",&lt;BR /&gt;alpha.real, alpha.imag, beta.real, beta.imag);&lt;BR /&gt;PrintParameters("TRANSA, TRANSB", transA, transB);&lt;BR /&gt;PrintParameters("LAYOUT", layout);&lt;BR /&gt;PrintArrayZ(&amp;amp;layout, FULLPRINT, GENERAL_MATRIX, &amp;amp;ma, &amp;amp;na, a, &amp;amp;lda, "A");&lt;BR /&gt;PrintArrayZ(&amp;amp;layout, FULLPRINT, GENERAL_MATRIX, &amp;amp;mb, &amp;amp;nb, b, &amp;amp;ldb, "B");&lt;BR /&gt;PrintArrayZ(&amp;amp;layout, FULLPRINT, GENERAL_MATRIX, &amp;amp;m, &amp;amp;n, c, &amp;amp;ldc, "C");&lt;/P&gt;
&lt;P&gt;/* Call ZGEMM subroutine ( C Interface ) */&lt;/P&gt;
&lt;P&gt;cblas_zgemm(layout, transA, transB, m, n, k, &amp;amp;alpha,&lt;BR /&gt;a, lda, b, ldb, &amp;amp;beta, c, ldc);&lt;/P&gt;
&lt;P&gt;/* Print output data */&lt;/P&gt;
&lt;P&gt;printf("\n\n OUTPUT DATA");&lt;BR /&gt;PrintArrayZ(&amp;amp;layout, FULLPRINT, GENERAL_MATRIX, &amp;amp;m, &amp;amp;n, c, &amp;amp;ldc, "C");&lt;/P&gt;
&lt;P&gt;mkl_free(a);&lt;BR /&gt;mkl_free(b);&lt;BR /&gt;mkl_free(c);&lt;/P&gt;
&lt;P&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Source code written by me&lt;/P&gt;
&lt;P&gt;void mkl_matrixMultiply(vector *result, vector *operand1, int op1_row, int op1_col, int trans1, vector *operand2, int op2_row, int op2_col, int trans2, int order)&lt;BR /&gt;{&lt;BR /&gt;/*Looping Index */&lt;BR /&gt;int i;&lt;/P&gt;
&lt;P&gt;MKL_INT m,n,k, lda, ldb, ldc;&lt;BR /&gt;MKL_Complex16 alpha, beta;&lt;BR /&gt;MKL_INT rmaxa, cmaxa, rmaxb, cmaxb, rmaxc, cmaxc;&lt;/P&gt;
&lt;P&gt;/*Matrix Declaration*/&lt;BR /&gt;MKL_Complex16 *a, *b, *c;&lt;/P&gt;
&lt;P&gt;/*Column_Major || Row_Major*/&lt;BR /&gt;CBLAS_LAYOUT layout;&lt;BR /&gt;CBLAS_TRANSPOSE transA, transB;&lt;/P&gt;
&lt;P&gt;/*SCALAR */&lt;BR /&gt;alpha.real = 1.0;&lt;BR /&gt;alpha.imag = 1.0;&lt;/P&gt;
&lt;P&gt;beta.real = 0.0;&lt;BR /&gt;beta.imag = 0.0;&lt;/P&gt;
&lt;P&gt;m = 3; /* Matrix A row */&lt;BR /&gt;n = 3; /* Matrix B Column */&lt;BR /&gt;k = 1; /* Matrix B Row, Matrix A Column */&lt;/P&gt;
&lt;P&gt;transA = CblasNoTrans;&lt;BR /&gt;transB = CblasNoTrans;&lt;/P&gt;
&lt;P&gt;layout = CblasRowMajor;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;if( transA == CblasNoTrans )&lt;BR /&gt;{&lt;BR /&gt;rmaxa = m + 1;&lt;BR /&gt;cmaxa = k;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;rmaxa = k + 1;&lt;BR /&gt;cmaxa = m;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;if( transB == CblasNoTrans )&lt;BR /&gt;{&lt;BR /&gt;rmaxb = k + 1;&lt;BR /&gt;cmaxb = n;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;rmaxb = n + 1;&lt;BR /&gt;cmaxb = k;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;rmaxc = m + 1;&lt;BR /&gt;cmaxc = n;&lt;/P&gt;
&lt;P&gt;if( layout == CblasRowMajor )&lt;BR /&gt;{&lt;BR /&gt;lda=cmaxa;&lt;BR /&gt;ldb=cmaxb;&lt;BR /&gt;ldc=cmaxc;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;lda=rmaxa;&lt;BR /&gt;ldb=rmaxb;&lt;BR /&gt;ldc=rmaxc;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;/*matrixC = alpha*matrixA*matrixB */&lt;BR /&gt;a = (MKL_Complex16*)mkl_calloc(rmaxa*cmaxa,(sizeof(MKL_Complex16)),64);&lt;BR /&gt;b = (MKL_Complex16*)mkl_calloc(rmaxb*cmaxb,(sizeof(MKL_Complex16)),64);&lt;BR /&gt;c = (MKL_Complex16*)mkl_calloc(rmaxc*cmaxc,(sizeof(MKL_Complex16)),64);&lt;/P&gt;
&lt;P&gt;/* Convert the vector arrays into complext_type arrays of data for Win32 library calls. */&lt;BR /&gt;/* Add the vector input values into a temporary complex array. */&lt;BR /&gt;for (i = 0; i &amp;lt; 3; i++)&lt;BR /&gt;{&lt;BR /&gt;/* A = M x K */&lt;BR /&gt;a[i].real = operand1-&amp;gt;real[i];&lt;BR /&gt;a[i].imag = operand1-&amp;gt;imag[i];&lt;/P&gt;
&lt;P&gt;/* B = K X N */&lt;BR /&gt;b[i].real = operand2-&amp;gt;real[i];&lt;BR /&gt;b[i].imag = operand2-&amp;gt;imag[i];&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;cblas_zgemm(layout, transA, transB, m, n, k, &amp;amp;alpha,&lt;BR /&gt;a, lda, b, ldb, &amp;amp;beta, c, ldc);&lt;/P&gt;
&lt;P&gt;for( i = 0; i &amp;lt; 9; i++ )&lt;BR /&gt;{&lt;BR /&gt;result-&amp;gt;real[i] = c[i].real;&lt;BR /&gt;result-&amp;gt;imag[i] = c[i].imag;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;mkl_free(a);&lt;BR /&gt;mkl_free(b);&lt;BR /&gt;mkl_free(c);&lt;/P&gt;
&lt;P&gt;} /* end of mkl_matrixMultiply */&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 22:01:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1340710#M32376</guid>
      <dc:creator>jeff222</dc:creator>
      <dc:date>2021-12-01T22:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1342531#M32411</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for sharing the requested details.&amp;nbsp; We are working on this issue internally, we will get back to you soon with an update.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Shanmukh.SS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 08:57:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1342531#M32411</guid>
      <dc:creator>ShanmukhS_Intel</dc:creator>
      <dc:date>2022-01-03T08:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1342533#M32412</link>
      <description>&lt;P&gt;would i still be able to used the 2018 version of mkl?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 16:28:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1342533#M32412</guid>
      <dc:creator>jeff222</dc:creator>
      <dc:date>2021-12-08T16:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1342534#M32413</link>
      <description>&lt;P&gt;is there another Matrix multiplication that could be used?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 16:30:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1342534#M32413</guid>
      <dc:creator>jeff222</dc:creator>
      <dc:date>2021-12-08T16:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1344230#M32451</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please let us know which version of Matlab you are using and which version of MKL is being used by that particular Matlab. Since Matlab uses MKL as a background, we need the info to check in that corresponding version of MKL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Shanmukh.SS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 09:00:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1344230#M32451</guid>
      <dc:creator>ShanmukhS_Intel</dc:creator>
      <dc:date>2022-01-03T09:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1344338#M32459</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not using MKL with matlab. Matlab was simply used to verify the results of the matrix multiplication being performed by cblas_zgemm. The version of matlab used MATLAB R2018B.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i believe the MKL version being used is the 2019 version of MKL. As i am seeing 2019 everywhere in the top level of the intel directory installed onto the machine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will be integrating the matrix multiplication onto a system using an intel processor.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Currently i am using CUnit test on a 64 bit machine to UT the results before trying it out on the system.&lt;/P&gt;
&lt;P&gt;These are the libraries that i have built in when using CUnit Test&lt;/P&gt;
&lt;P&gt;libmkl_core.a&lt;/P&gt;
&lt;P&gt;libmkl_gf_lp64.a&lt;/P&gt;
&lt;P&gt;libmkl_sequential.a&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have had success using this same set up to verify the results of lapacke_zgetri.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When a solution is found would intel provide me with a patch? Or would i have to reinstall the latest version of MKL?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeff&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 16:42:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1344338#M32459</guid>
      <dc:creator>jeff222</dc:creator>
      <dc:date>2021-12-15T16:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1346228#M32490</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&lt;EM&gt;When a solution is found would intel provide me with a patch? Or would i have to reinstall the latest version of MKL?&amp;nbsp;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;We would like to inform you that the shared functionality is working fine and it's not a bug.&lt;/P&gt;
&lt;P&gt;Kindly execute the code with correct alpha and beta values mentioned below in your code and check the result. We would also like to inform you that the code got executed fine with correct results (matching with MATLAB results shared by you) from our side.&lt;/P&gt;
&lt;P&gt;alpha.real = 1.0; alpha.imag = 0.0;&lt;/P&gt;
&lt;P&gt;beta.real = 1.0; beta.imag = 0.0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Shanmukh.SS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 11:29:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1346228#M32490</guid>
      <dc:creator>ShanmukhS_Intel</dc:creator>
      <dc:date>2022-03-08T11:29:26Z</dc:date>
    </item>
    <item>
      <title>Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1347524#M32519</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Reminder:&lt;/P&gt;&lt;P&gt;Is your issue resolved? Kindly let us know if we could close this thread from our end.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Below are the CBLAS_ZGEMM data calculations. &lt;/P&gt;&lt;P&gt;C B L A S _ Z G E M M EXAMPLE PROGRAM&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;INPUT DATA&lt;/P&gt;&lt;P&gt;M=3 N=3 K=1&lt;/P&gt;&lt;P&gt;ALPHA =( 1.0, 0.0 ) BETA =( 1.0, 0.0 )&lt;/P&gt;&lt;P&gt;TRANSA = CblasNoTrans TRANSB = CblasNoTrans&lt;/P&gt;&lt;P&gt;LAYOUT = CblasRowMajor&lt;/P&gt;&lt;P&gt;ARRAY A LDA=1&lt;/P&gt;&lt;P&gt;( 83.00, 10.00)&lt;/P&gt;&lt;P&gt;( 31.00, 30.00)&lt;/P&gt;&lt;P&gt;( 23.00, 4.00)&lt;/P&gt;&lt;P&gt;ARRAY B LDB=3&lt;/P&gt;&lt;P&gt;( 83.00,-10.00) ( 31.00,-30.00) ( 23.00, -4.00)&lt;/P&gt;&lt;P&gt;ARRAY C LDC=3&lt;/P&gt;&lt;P&gt;( 0.00, 0.00) ( 0.00, 0.00) ( 0.00, 0.00)&lt;/P&gt;&lt;P&gt;( 0.00, 0.00) ( 0.00, 0.00) ( 0.00, 0.00)&lt;/P&gt;&lt;P&gt;( 0.00, 0.00) ( 0.00, 0.00) ( 0.00, 0.00)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;OUTPUT DATA&lt;/P&gt;&lt;P&gt;ARRAY C LDC=3&lt;/P&gt;&lt;P&gt;(6989.00, 0.00) (2873.00,-2180.00) (1949.00,-102.00)&lt;/P&gt;&lt;P&gt;(2873.00,2180.00) (1861.00, 0.00) (833.00,566.00)&lt;/P&gt;&lt;P&gt;(1949.00,102.00) (833.00,-566.00) (545.00, 0.00)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Shanmukh.SS&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Dec 2021 10:33:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1347524#M32519</guid>
      <dc:creator>ShanmukhS_Intel</dc:creator>
      <dc:date>2021-12-30T10:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1347835#M32522</link>
      <description>Thank you for all your help and collaboration. I appreciate it</description>
      <pubDate>Sat, 01 Jan 2022 00:00:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1347835#M32522</guid>
      <dc:creator>jeff222</dc:creator>
      <dc:date>2022-01-01T00:00:46Z</dc:date>
    </item>
    <item>
      <title>Re:cblas_zgemm not producing correct results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1348037#M32524</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Shanmukh.SS&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Jan 2022 09:03:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-zgemm-not-producing-correct-results/m-p/1348037#M32524</guid>
      <dc:creator>ShanmukhS_Intel</dc:creator>
      <dc:date>2022-01-03T09:03:55Z</dc:date>
    </item>
  </channel>
</rss>

