<?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 Thank you for your in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-mkl-omatadd/m-p/1038267#M20575</link>
    <description>&lt;P&gt;Thank you for your explanation Evarist, it makes sense now !&lt;/P&gt;</description>
    <pubDate>Sat, 07 Mar 2015 20:08:32 GMT</pubDate>
    <dc:creator>Guillaume_A_</dc:creator>
    <dc:date>2015-03-07T20:08:32Z</dc:date>
    <item>
      <title>Question about mkl_?omatadd</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-mkl-omatadd/m-p/1038265#M20573</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;The description of&amp;nbsp;&lt;A href="https://software.intel.com/en-us/node/520865#7A11D24D-8447-4CE2-9A08-0C8924565E84"&gt;mkl_?omatadd&lt;/A&gt; function in the manual is a bit confusing:&lt;/P&gt;

&lt;P&gt;- parameter m is described as "The number of matrix rows". Which one ? (A, B or C ?) What if I want to transpose A or B ?&lt;/P&gt;

&lt;P&gt;- same question about parameter n.&lt;/P&gt;

&lt;P&gt;- Why is ldc an output parameter ??&lt;/P&gt;

&lt;P&gt;I wanna do this kind of operation "C = alpha*A + beta*B^t".&lt;/P&gt;

&lt;P&gt;Thanks in advance for your help,&lt;/P&gt;

&lt;P&gt;Guix&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2015 13:25:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-mkl-omatadd/m-p/1038265#M20573</guid>
      <dc:creator>Guillaume_A_</dc:creator>
      <dc:date>2015-03-06T13:25:18Z</dc:date>
    </item>
    <item>
      <title>Hi Guix,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-mkl-omatadd/m-p/1038266#M20574</link>
      <description>&lt;P&gt;Hi Guix,&lt;/P&gt;

&lt;P&gt;Yes, you are right, omatadd documentation is slightly confusing.&lt;BR /&gt;
	Thank you for the question. Let me try to clarify.&lt;/P&gt;

&lt;P&gt;Parameters &lt;STRONG&gt;m&lt;/STRONG&gt; and &lt;STRONG&gt;n&lt;/STRONG&gt; stand for rows and columns of matrix C (the only matrix to which op() is not applied). Since you specify the &lt;STRONG&gt;m&lt;/STRONG&gt; and &lt;STRONG&gt;n&lt;/STRONG&gt;, the matrices op(A) and op(B) should have the same sizes.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;lda&lt;/STRONG&gt;, &lt;STRONG&gt;ldb&lt;/STRONG&gt; and &lt;STRONG&gt;ldc&lt;/STRONG&gt; are leading dimensions for original matrices (i.e. with-out any op operations). Of course &lt;STRONG&gt;ldc&lt;/STRONG&gt; is not 'out' parameter, but 'in'. This is a typo.&lt;/P&gt;

&lt;P&gt;A small examples that performs&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;C &amp;lt;-- alpha*A + beta*B^T&lt;/PRE&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;stdio.h&amp;gt;
#include "mkl.h"

static inline printA(double *x, int rows, int cols, int lda) {
    for (int i = 0; i &amp;lt; rows; ++i) {
        for (int j = 0; j &amp;lt; cols; ++j) {
            printf("%8.0f", x[i*lda + j]);
        }
        printf("\n");
    }
    printf("\n");
}

int main() {
    double a[] = {
        100, 200, 300,
        400, 500, 600,
        700, 800, 900,
          0,   0,   0  };
    double b[] = {
        1, 2, 3, 0, 0,
        4, 5, 6, 0, 0,
        7, 8, 9, 0, 0,
        0, 0, 0, 0, 0  };
    double c[12] = {
        0, 0, 0,
        0, 0, 0,
        0, 0, 0  };

    char transa, transb;
    double alpha = 1., beta = 1.;
    size_t m, n;
    size_t lda = 3, ldb = 5, ldc = 3;

    transa = 'N'; transb = 'T';
    m = 2; n = 3;
    mkl_domatadd('R', transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc);
    printA(c, 2, 3, ldc);

    return 0;
}&lt;/PRE&gt;

&lt;P&gt;Here we get matrix C of form 2x3 with &lt;STRONG&gt;ldc&lt;/STRONG&gt; = 3 using block 2x3 from matrix A and 3x2 from matrix B.&lt;/P&gt;

&lt;P&gt;The result is:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;101     204     307
402     505     608&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Mar 2015 05:03:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-mkl-omatadd/m-p/1038266#M20574</guid>
      <dc:creator>Evarist_F_Intel</dc:creator>
      <dc:date>2015-03-07T05:03:22Z</dc:date>
    </item>
    <item>
      <title>Thank you for your</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-mkl-omatadd/m-p/1038267#M20575</link>
      <description>&lt;P&gt;Thank you for your explanation Evarist, it makes sense now !&lt;/P&gt;</description>
      <pubDate>Sat, 07 Mar 2015 20:08:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-mkl-omatadd/m-p/1038267#M20575</guid>
      <dc:creator>Guillaume_A_</dc:creator>
      <dc:date>2015-03-07T20:08:32Z</dc:date>
    </item>
  </channel>
</rss>

