<?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: multiply column vector by row vector using dgemm in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867145#M8081</link>
    <description>&lt;P&gt;Hagai,&lt;BR /&gt;&lt;BR /&gt;According to the mkl_cblas.h &lt;STRONG&gt;cblas_gemm&lt;/STRONG&gt; function has the follwing interface:&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;void cblas_dgemm(const CBLAS_ORDER Order, const CBLAS_TRANSPOSE TransA,&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt; const CBLAS_TRANSPOSE TransB, const MKL_INT M, const MKL_INT N,&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt; const MKL_INT K, const double alpha, const double *A,&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt; const MKL_INT lda, const double *B, const MKL_INT ldb,&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt; const double beta, double *C, const MKL_INT ldc);&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;MKL ERROR: Parameter 11 was incorrect on entry to cblas_dgemm&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;This means, that &lt;EM&gt;ldb &lt;/EM&gt;argument is wrong in your example.&lt;/P&gt;
&lt;P&gt;Please use the following arguments:&lt;/P&gt;
&lt;P&gt; cblas_dgemm(&lt;BR /&gt; CblasRowMajor,&lt;BR /&gt; CblasNoTrans,&lt;BR /&gt; CblasNoTrans,&lt;BR /&gt; HEIGHT,&lt;BR /&gt; WIDTH,&lt;BR /&gt; 1,&lt;BR /&gt; 1.0,&lt;BR /&gt; ColumnVector,&lt;BR /&gt; 1, // !!!&lt;BR /&gt; RowVector,&lt;BR /&gt; WIDTH, // !!!&lt;BR /&gt; 1.0,&lt;BR /&gt; Result,&lt;BR /&gt; WIDTH); // !!!&lt;/P&gt;
&lt;P&gt;So, the result is:&lt;/P&gt;
&lt;P&gt;2 2 2&lt;BR /&gt;2 2 2&lt;BR /&gt;2 2 2&lt;BR /&gt;2 2 2&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;--Victor&lt;/P&gt;
&lt;BR /&gt;</description>
    <pubDate>Wed, 09 Dec 2009 08:15:19 GMT</pubDate>
    <dc:creator>barragan_villanueva_</dc:creator>
    <dc:date>2009-12-09T08:15:19Z</dc:date>
    <item>
      <title>multiply column vector by row vector using dgemm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867144#M8080</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
	I am trying to multiply a 4x1 matrix (a column vector) by a 1x3 matrix (row vector) using dgemm. The code is attached, I can't seem to get the parameters right. The attached version outputs "MKL ERROR: Parameter 11 was incorrect on entry to cblas_dgemm". I tried different values and couldn't get it right.&lt;BR /&gt;
	Any clues?&lt;BR /&gt;
	&lt;BR /&gt;
	Thanks,&lt;BR /&gt;
	Hagai.&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;A href="https://community.intel.com/legacyfs/online/drupal_files/83/b1/multcolumnrow.cpp"&gt;multcolumnrow.cpp&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2009 20:46:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867144#M8080</guid>
      <dc:creator>hagai_sela</dc:creator>
      <dc:date>2009-12-07T20:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: multiply column vector by row vector using dgemm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867145#M8081</link>
      <description>&lt;P&gt;Hagai,&lt;BR /&gt;&lt;BR /&gt;According to the mkl_cblas.h &lt;STRONG&gt;cblas_gemm&lt;/STRONG&gt; function has the follwing interface:&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;void cblas_dgemm(const CBLAS_ORDER Order, const CBLAS_TRANSPOSE TransA,&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt; const CBLAS_TRANSPOSE TransB, const MKL_INT M, const MKL_INT N,&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt; const MKL_INT K, const double alpha, const double *A,&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt; const MKL_INT lda, const double *B, const MKL_INT ldb,&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt; const double beta, double *C, const MKL_INT ldc);&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;MKL ERROR: Parameter 11 was incorrect on entry to cblas_dgemm&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;This means, that &lt;EM&gt;ldb &lt;/EM&gt;argument is wrong in your example.&lt;/P&gt;
&lt;P&gt;Please use the following arguments:&lt;/P&gt;
&lt;P&gt; cblas_dgemm(&lt;BR /&gt; CblasRowMajor,&lt;BR /&gt; CblasNoTrans,&lt;BR /&gt; CblasNoTrans,&lt;BR /&gt; HEIGHT,&lt;BR /&gt; WIDTH,&lt;BR /&gt; 1,&lt;BR /&gt; 1.0,&lt;BR /&gt; ColumnVector,&lt;BR /&gt; 1, // !!!&lt;BR /&gt; RowVector,&lt;BR /&gt; WIDTH, // !!!&lt;BR /&gt; 1.0,&lt;BR /&gt; Result,&lt;BR /&gt; WIDTH); // !!!&lt;/P&gt;
&lt;P&gt;So, the result is:&lt;/P&gt;
&lt;P&gt;2 2 2&lt;BR /&gt;2 2 2&lt;BR /&gt;2 2 2&lt;BR /&gt;2 2 2&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;--Victor&lt;/P&gt;
&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Dec 2009 08:15:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867145#M8081</guid>
      <dc:creator>barragan_villanueva_</dc:creator>
      <dc:date>2009-12-09T08:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: multiply column vector by row vector using dgemm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867146#M8082</link>
      <description>Worked. Thanks!&lt;BR /&gt;&lt;BR /&gt;Hagai.&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Dec 2009 18:25:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867146#M8082</guid>
      <dc:creator>hagai_sela</dc:creator>
      <dc:date>2009-12-09T18:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: multiply column vector by row vector using dgemm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867147#M8083</link>
      <description>Hagai,&lt;BR /&gt;&lt;BR /&gt;BTW,you need tochange PrintMatrix function to see results correctly:&lt;BR /&gt;(I used i+1)&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;&lt;EM&gt;void PrintMatrix(double* pMatrix, const size_t nRows, const size_t nCols)&lt;BR /&gt;{&lt;BR /&gt; for (size_t i=0; i&lt;NROWS&gt;&lt;/NROWS&gt; {&lt;BR /&gt; for (size_t j=0; j&lt;NCOLS&gt;&lt;/NCOLS&gt; {&lt;BR /&gt; cout &amp;lt;&amp;lt; pMatrix[i * nCols + j] &amp;lt;&amp;lt; 't'; // !!!&lt;BR /&gt; }&lt;BR /&gt; cout &amp;lt;&amp;lt; endl;&lt;BR /&gt; }&lt;BR /&gt; cout &amp;lt;&amp;lt; endl;&lt;BR /&gt;}&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;int main()&lt;BR /&gt;{&lt;BR /&gt; double ColumnVector[HEIGHT];&lt;BR /&gt; double RowVector[WIDTH];&lt;BR /&gt; double Result[WIDTH * HEIGHT];&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt; for (int i=0; i&lt;HEIGHT&gt;&lt;/HEIGHT&gt; ColumnVector&lt;I&gt; = i+1; // !!!&lt;BR /&gt; PrintMatrix(ColumnVector, HEIGHT, 1);&lt;/I&gt;&lt;/EM&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt; for (int i=0; i&lt;WIDTH&gt;&lt;/WIDTH&gt; RowVector&lt;I&gt; = i+1; // !!!&lt;BR /&gt; PrintMatrix(RowVector, 1, WIDTH);&lt;/I&gt;&lt;/EM&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt; cblas_dgemm(&lt;BR /&gt; CblasRowMajor,&lt;BR /&gt; CblasNoTrans,&lt;BR /&gt; CblasNoTrans,&lt;BR /&gt; HEIGHT,&lt;BR /&gt; WIDTH,&lt;BR /&gt; 1,&lt;BR /&gt; 1.0,&lt;BR /&gt; ColumnVector,&lt;BR /&gt; 1,&lt;BR /&gt; RowVector,&lt;BR /&gt; WIDTH,&lt;BR /&gt; 1.0,&lt;BR /&gt; Result,&lt;BR /&gt; WIDTH);&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt; PrintMatrix(Result, HEIGHT, WIDTH);&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/EM&gt;&lt;/P&gt;
&lt;BR /&gt;Pleaselook at MKL examples/cblas/source/cblas_dgemmx.c file for more details.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;--Victor</description>
      <pubDate>Thu, 10 Dec 2009 07:05:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867147#M8083</guid>
      <dc:creator>barragan_villanueva_</dc:creator>
      <dc:date>2009-12-10T07:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: multiply column vector by row vector using dgemm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867148#M8084</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/93649"&gt;Victor Pasko (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;P&gt;Hagai,&lt;BR /&gt;&lt;BR /&gt;According to the mkl_cblas.h &lt;STRONG&gt;cblas_gemm&lt;/STRONG&gt; function has the follwing interface:&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;void cblas_dgemm(const CBLAS_ORDER Order, const CBLAS_TRANSPOSE TransA,&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt; const CBLAS_TRANSPOSE TransB, const MKL_INT M, const MKL_INT N,&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt; const MKL_INT K, const double alpha, const double *A,&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt; const MKL_INT lda, const double *B, const MKL_INT ldb,&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt; const double beta, double *C, const MKL_INT ldc);&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;MKL ERROR: Parameter 11 was incorrect on entry to cblas_dgemm&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;This means, that &lt;EM&gt;ldb &lt;/EM&gt;argument is wrong in your example.&lt;/P&gt;
&lt;P&gt;Please use the following arguments:&lt;/P&gt;
&lt;P&gt;cblas_dgemm(&lt;BR /&gt; CblasRowMajor,&lt;BR /&gt; CblasNoTrans,&lt;BR /&gt; CblasNoTrans,&lt;BR /&gt; HEIGHT,&lt;BR /&gt; WIDTH,&lt;BR /&gt; 1,&lt;BR /&gt; 1.0,&lt;BR /&gt; ColumnVector,&lt;BR /&gt; 1, // !!!&lt;BR /&gt; RowVector,&lt;BR /&gt; WIDTH, // !!!&lt;BR /&gt; 1.0,&lt;BR /&gt; Result,&lt;BR /&gt; WIDTH); // !!!&lt;/P&gt;
&lt;P&gt;So, the result is:&lt;/P&gt;
&lt;P&gt;2 2 2&lt;BR /&gt;2 2 2&lt;BR /&gt;2 2 2&lt;BR /&gt;2 2 2&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;--Victor&lt;/P&gt;
&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Hello Victor Pasco,&lt;BR /&gt;&lt;BR /&gt;i am trying to do same with the dgemm(..) but it still does not work for me. I am multiplying an A:= 16x4 with B:= 4x1. alpha=1.0, beta=1.0. a,b are stored in rows so the first parameters have to be "T" for transposed right?&lt;BR /&gt;&lt;BR /&gt;dgemm("T","T",&amp;amp;sixteen,&amp;amp;one,&amp;amp;four,α,a,&amp;amp;sixteen,b,&amp;amp;four,β,c,&amp;amp;sixteen);</description>
      <pubDate>Fri, 11 Dec 2009 16:13:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867148#M8084</guid>
      <dc:creator>darkfate</dc:creator>
      <dc:date>2009-12-11T16:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: multiply column vector by row vector using dgemm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867149#M8085</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/437078"&gt;darkfate&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;&lt;BR /&gt;Hello Victor Pasco,&lt;BR /&gt;&lt;BR /&gt;i am trying to do same with the dgemm(..) but it still does not work for me. I am multiplying an A:= 16x4 with B:= 4x1. alpha=1.0, beta=1.0. a,b are stored in rows so the first parameters have to be "T" for transposed right?&lt;BR /&gt;&lt;BR /&gt;dgemm("T","T",&amp;amp;sixteen,&amp;amp;one,&amp;amp;four,α,a,&amp;amp;sixteen,b,&amp;amp;four,β,c,&amp;amp;sixteen);&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Hagai,&lt;BR /&gt;&lt;BR /&gt;So, you decided to not use CBLAS while you have alreadyworking sources.&lt;BR /&gt;&lt;BR /&gt;And what's error message now?Or it's another problem.&lt;BR /&gt;Did you look at corresponding BLAS examples (on FORTRAN) and MKL docs to correctly pass arguments from C/C++?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;--Victor</description>
      <pubDate>Mon, 14 Dec 2009 11:48:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867149#M8085</guid>
      <dc:creator>barragan_villanueva_</dc:creator>
      <dc:date>2009-12-14T11:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: multiply column vector by row vector using dgemm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867150#M8086</link>
      <description>Note that, in general, you will need to initialize the output matrix C or 'Result' (except when \beta is zero) before calling cblas_dgemm.</description>
      <pubDate>Thu, 26 Aug 2010 18:09:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiply-column-vector-by-row-vector-using-dgemm/m-p/867150#M8086</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2010-08-26T18:09:35Z</dc:date>
    </item>
  </channel>
</rss>

