<?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: MKL cgemm in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cgemm/m-p/982629#M17520</link>
    <description>As a follow up to my previous post, I have corrected the code that posted earlier. For straight forward complex matrix multiplication of the form C := Alpha*A*B + Beta*C, let RowA, ColA be the number of rows and columns of A, RowB, ColB be the number of rows and columns of B respectively. C is assumed to be compliant to the dimensions of multiplication of A and B. Alpha and Beta are both complex values. The matrix is stored in a row-major type array.&lt;BR /&gt;&lt;BR /&gt;Then using cblas_cgemm, the resultant C can be found in this manner:&lt;BR /&gt;&lt;BR /&gt;cblas_cgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, RowA, ColB, ColA, Α, A, ColA, B, ColB, Β, C, ColB);&lt;BR /&gt;(Refer to mkl_cblas.h for the prototype of cblas_cgemm.)&lt;BR /&gt;&lt;BR /&gt;Here, lda, ldb, and ldc are the number of entries for each row. I hope this info is useful for anyone out there trying to perform complex matrix multiplication.&lt;P&gt;Message Edited by hotimhou@yahoo.com on &lt;SPAN class="date_text"&gt;07-30-2005&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;02:38 AM&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 30 Jul 2005 16:36:32 GMT</pubDate>
    <dc:creator>hotimhou</dc:creator>
    <dc:date>2005-07-30T16:36:32Z</dc:date>
    <item>
      <title>MKL cgemm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cgemm/m-p/982626#M17517</link>
      <description>Hi,&lt;BR /&gt;I would like to find out if anyone has any problems using the function cgemm in MKL. I can't seem to get it right, even though I've tried different combinations of the command. Attached here are the C code for a 4x4 matrix premultiplying a 4x6 matrix.&lt;BR /&gt;&lt;BR /&gt;The results are here:&lt;BR /&gt;&lt;BR /&gt;A = [&lt;BR /&gt;0.0+1.0*j 1.0+2.0*j 2.0+3.0*j 3.0+4.0*j ;&lt;BR /&gt;1.0+2.0*j 2.0+3.0*j 3.0+4.0*j 4.0+5.0*j ;&lt;BR /&gt;2.0+3.0*j 3.0+4.0*j 4.0+5.0*j 5.0+6.0*j ;&lt;BR /&gt;3.0+4.0*j 4.0+5.0*j 5.0+6.0*j 6.0+7.0*j ;&lt;BR /&gt;]&lt;BR /&gt;&lt;BR /&gt;B = [&lt;BR /&gt;0.0+1.0*j 1.0+2.0*j 2.0+3.0*j 3.0+4.0*j 4.0+5.0*j 5.0+6.0*j ;&lt;BR /&gt;1.0+2.0*j 2.0+3.0*j 3.0+4.0*j 4.0+5.0*j 5.0+6.0*j 6.0+7.0*j ;&lt;BR /&gt;2.0+3.0*j 3.0+4.0*j 4.0+5.0*j 5.0+6.0*j 6.0+7.0*j 7.0+8.0*j ;&lt;BR /&gt;3.0+4.0*j 4.0+5.0*j 5.0+6.0*j 6.0+7.0*j 7.0+8.0*j 8.0+9.0*j ;&lt;BR /&gt;]&lt;BR /&gt;&lt;BR /&gt;C = [&lt;BR /&gt;-16.0+40.0*j -20.0+56.0*j -24.0+72.0*j -28.0+88.0*j -22.0+44.0*j -26.0+72.0*j ;&lt;BR /&gt;-30.0+100.0*j -34.0+128.0*j -28.0+88.0*j -32.0+128.0*j -36.0+168.0*j -40.0+208.0*j ;&lt;BR /&gt;-24.0+72.0*j -28.0+104.0*j -32.0+136.0*j -36.0+168.0*j -30.0+76.0*j -34.0+120.0*j ;&lt;BR /&gt;-38.0+164.0*j -42.0+208.0*j -36.0+120.0*j -40.0+176.0*j -44.0+232.0*j -48.0+288.0*j ;&lt;BR /&gt;]&lt;BR /&gt;&lt;BR /&gt;The results are different from those I got from Octave or Matlab.&lt;BR /&gt;Can anyone advise me what I did wrong? Thanks in advance!&lt;BR /&gt;&lt;BR /&gt;TH</description>
      <pubDate>Thu, 28 Jul 2005 21:28:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cgemm/m-p/982626#M17517</guid>
      <dc:creator>hotimhou</dc:creator>
      <dc:date>2005-07-28T21:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: MKL cgemm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cgemm/m-p/982627#M17518</link>
      <description>&lt;DIV&gt;It looks like you are setting up a row major data structure and passing it to the CGEMM function which expects a column-major data structure. Either you'll need to initialize A and B so thatthey store by column rather than row and have pA, pB, and pC point to columns instead of rows -or- you could try out the cblas_cgemm routine described in an appendix of the reference manual.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;-Todd&lt;/DIV&gt;</description>
      <pubDate>Fri, 29 Jul 2005 03:58:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cgemm/m-p/982627#M17518</guid>
      <dc:creator>Todd_R_Intel</dc:creator>
      <dc:date>2005-07-29T03:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: MKL cgemm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cgemm/m-p/982628#M17519</link>
      <description>Hi Todd,&lt;BR /&gt;Thanks for your help. I tried cblas_cgemm as well. I could compile the code, but it produces a segmentation fault when cblas_cgemm was called. Basically, I just replaced the cgemm call in the previous code with cblas_cgemm, with an additional parameter specifying the matrices being row-major. The program was linked with:&lt;BR /&gt;        lmkl_ia32 -lguide -lpthread -lm&lt;BR /&gt;the way it was documented. Any problem with such a scheme?</description>
      <pubDate>Fri, 29 Jul 2005 07:39:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cgemm/m-p/982628#M17519</guid>
      <dc:creator>hotimhou</dc:creator>
      <dc:date>2005-07-29T07:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: MKL cgemm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cgemm/m-p/982629#M17520</link>
      <description>As a follow up to my previous post, I have corrected the code that posted earlier. For straight forward complex matrix multiplication of the form C := Alpha*A*B + Beta*C, let RowA, ColA be the number of rows and columns of A, RowB, ColB be the number of rows and columns of B respectively. C is assumed to be compliant to the dimensions of multiplication of A and B. Alpha and Beta are both complex values. The matrix is stored in a row-major type array.&lt;BR /&gt;&lt;BR /&gt;Then using cblas_cgemm, the resultant C can be found in this manner:&lt;BR /&gt;&lt;BR /&gt;cblas_cgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, RowA, ColB, ColA, Α, A, ColA, B, ColB, Β, C, ColB);&lt;BR /&gt;(Refer to mkl_cblas.h for the prototype of cblas_cgemm.)&lt;BR /&gt;&lt;BR /&gt;Here, lda, ldb, and ldc are the number of entries for each row. I hope this info is useful for anyone out there trying to perform complex matrix multiplication.&lt;P&gt;Message Edited by hotimhou@yahoo.com on &lt;SPAN class="date_text"&gt;07-30-2005&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;02:38 AM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jul 2005 16:36:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cgemm/m-p/982629#M17520</guid>
      <dc:creator>hotimhou</dc:creator>
      <dc:date>2005-07-30T16:36:32Z</dc:date>
    </item>
  </channel>
</rss>

