<?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 Quote:iliyapolak wrote: in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941868#M14564</link>
    <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;iliyapolak wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Wanted to ask the same question:-)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;C almost drive me crazy!! &amp;nbsp;Have you gotten the solution to your problem?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 29 Sep 2013 14:00:21 GMT</pubDate>
    <dc:creator>Xiaokun_H_</dc:creator>
    <dc:date>2013-09-29T14:00:21Z</dc:date>
    <item>
      <title>Incorrect result of Zgemm in Windows env C++</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941862#M14558</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;I am writing code to process mat multiply. And I write a little program to test the result of zgemm. But the result is incorrect and I do not really know the reason. I write code on my labtop. -i7 &amp;nbsp; 64bit &amp;nbsp;windows8 &amp;nbsp; visual studio 2010 &amp;nbsp; mkl&amp;nbsp;10.0.3.021&lt;/P&gt;
&lt;P&gt;Here is the code. The size of A is 3*2 &amp;nbsp;and the size of B is 2*2 which is a unit matrix. I think the result is A itself but it seems not.&lt;/P&gt;
&lt;P&gt;int main() &lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;int *m =new int; //m*n n*k&lt;BR /&gt;int *n =new int;&lt;BR /&gt;int *k =new int;&lt;/P&gt;
&lt;P&gt;*m =3;&lt;BR /&gt;*n = 2;&lt;BR /&gt;*k = 2;&lt;/P&gt;
&lt;P&gt;MKL_Complex16 *A = new MKL_Complex16 [6];&lt;BR /&gt;MKL_Complex16 *B = new MKL_Complex16 [4];&lt;BR /&gt;MKL_Complex16 *N = new MKL_Complex16 [4];&lt;/P&gt;
&lt;P&gt;A[0].real = 1;&lt;BR /&gt;A[1].real = 2;&lt;BR /&gt;A[2].real = 3;&lt;BR /&gt;A[3].real = 4;&lt;BR /&gt;A[4].real = 5;&lt;BR /&gt;A[5].real = 6;&lt;BR /&gt;&lt;BR /&gt;for(int i=0; i&amp;lt;6; i++) A&lt;I&gt;.imag =0;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;B[0].real = 1;&lt;BR /&gt;B[1].real = 0;&lt;BR /&gt;A[2].real = 0;&lt;BR /&gt;A[3].real = 1;&lt;/P&gt;
&lt;P&gt;for(int i=0; i&amp;lt;4; i++) B&lt;I&gt;.imag =0;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;MKL_Complex16 *alpha = new MKL_Complex16;&lt;BR /&gt;MKL_Complex16 *beta = new MKL_Complex16;&lt;/P&gt;
&lt;P&gt;MKL_Complex16 cAlpha = {1,0}, cBeta = {0,0};&lt;BR /&gt;alpha = &amp;amp;cAlpha;&lt;BR /&gt;beta = &amp;amp;cBeta;&lt;/P&gt;
&lt;P&gt;zgemm("n","n",m,k,n,alpha,A,m,B,n,beta,N,m);&lt;BR /&gt;&lt;BR /&gt;for(int i=0;i&amp;lt;6;i++) std::cout&amp;lt;&amp;lt;(N+i)&amp;lt;&amp;lt;" "&amp;lt;&amp;lt;N&lt;I&gt;.real&amp;lt;&amp;lt;" "&amp;lt;&amp;lt;N&lt;I&gt;.imag&amp;lt;&amp;lt;std::endl;&lt;BR /&gt;&lt;BR /&gt;getchar(); &lt;BR /&gt;return 0; &lt;BR /&gt;}&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="C:\Users\huangxk\Pictures\result" /&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I do not know whether I output the result in a right way. I really need help. Thank all of you a lot!!&lt;/P&gt;
&lt;P&gt;Claire&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2013 02:17:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941862#M14558</guid>
      <dc:creator>Xiaokun_H_</dc:creator>
      <dc:date>2013-09-29T02:17:05Z</dc:date>
    </item>
    <item>
      <title>Did you really mean A here,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941863#M14559</link>
      <description>&lt;P&gt;Did you really mean A here, not B?&lt;/P&gt;
&lt;P&gt;A[2].real = 0;&lt;BR /&gt;A[3].real = 1&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2013 04:28:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941863#M14559</guid>
      <dc:creator>crispybits</dc:creator>
      <dc:date>2013-09-29T04:28:17Z</dc:date>
    </item>
    <item>
      <title>Wanted to ask the same</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941864#M14560</link>
      <description>&lt;P&gt;Wanted to ask the same question:-)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2013 07:29:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941864#M14560</guid>
      <dc:creator>Bernard</dc:creator>
      <dc:date>2013-09-29T07:29:08Z</dc:date>
    </item>
    <item>
      <title>Claire,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941865#M14561</link>
      <description>&lt;P&gt;Claire,&lt;/P&gt;
&lt;P&gt;Anther notes for the this code that zgem is fortran interface. You are calling the fortran function in a C code, the A/B/C array is assumed as the column-major data. For example, the A in this code, the actually matrix data is: &lt;BR /&gt;&amp;nbsp; 1 &amp;nbsp; 4&lt;BR /&gt;&amp;nbsp; 2 &amp;nbsp; 5&lt;BR /&gt;&amp;nbsp; 3 &amp;nbsp; 6&lt;/P&gt;
&lt;P&gt;If you want to use the C function, you can call cblas function.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Chao&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2013 08:34:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941865#M14561</guid>
      <dc:creator>Chao_Y_Intel</dc:creator>
      <dc:date>2013-09-29T08:34:05Z</dc:date>
    </item>
    <item>
      <title>Quote:crispybits wrote:</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941866#M14562</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;crispybits wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Did you really mean A here, not B?&lt;/P&gt;
&lt;P&gt;A[2].real = 0;&lt;BR /&gt;A[3].real = 1&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I find my mistake here. It should be B's value. Thank you. :-)&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2013 13:50:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941866#M14562</guid>
      <dc:creator>Xiaokun_H_</dc:creator>
      <dc:date>2013-09-29T13:50:27Z</dc:date>
    </item>
    <item>
      <title>Quote:Chao Y (Intel) wrote:</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941867#M14563</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Chao Y (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Claire,&lt;/P&gt;
&lt;P&gt;Anther notes for the this code that zgem is fortran interface. You are calling the fortran function in a C code, the A/B/C array is assumed as the column-major data. For example, the A in this code, the actually matrix data is: &lt;BR /&gt;&amp;nbsp; 1 &amp;nbsp; 4&lt;BR /&gt;&amp;nbsp; 2 &amp;nbsp; 5&lt;BR /&gt;&amp;nbsp; 3 &amp;nbsp; 6&lt;/P&gt;
&lt;P&gt;If you want to use the C function, you can call cblas function.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Chao&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I always have questions about the sequence of the matrix's values are saved. According to your description, the address adds with priority in the column direction from up to down, right? I used to writing codes with MATLAB and it seems that they saved the value in same sequence. Thank you!&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2013 13:58:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941867#M14563</guid>
      <dc:creator>Xiaokun_H_</dc:creator>
      <dc:date>2013-09-29T13:58:04Z</dc:date>
    </item>
    <item>
      <title>Quote:iliyapolak wrote:</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941868#M14564</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;iliyapolak wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Wanted to ask the same question:-)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;C almost drive me crazy!! &amp;nbsp;Have you gotten the solution to your problem?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2013 14:00:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Incorrect-result-of-Zgemm-in-Windows-env-C/m-p/941868#M14564</guid>
      <dc:creator>Xiaokun_H_</dc:creator>
      <dc:date>2013-09-29T14:00:21Z</dc:date>
    </item>
  </channel>
</rss>

