<?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 Hi Gennady,  in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171320#M28593</link>
    <description>&lt;P&gt;Hi Gennady,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the prompt reply. I quickly translated your example to C++ and noticed the following.&amp;nbsp;The mkl_domatcopy is being called with rows=2 and cols=4 (3rd and 4th argument). However, the matrix B (which is clear both from in-code comments and its dst_stride=2) is 4x2. That is, it has 4 rows and 2 columns and is&amp;nbsp;stored in row-major format&amp;nbsp; (stride=2).&lt;/P&gt;&lt;P&gt;However the MKL documentation states:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;rows &amp;nbsp; &amp;nbsp;The number of rows in matrix&amp;nbsp;B&amp;nbsp;(the destination matrix).&lt;/P&gt;&lt;P&gt;cols &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;The number of columns in matrix&amp;nbsp;B&amp;nbsp;(the destination matrix).&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;To me this indicates&amp;nbsp;that MKL's documentation is confusing and not consistent with what is actually meant by rows/cols. Probably, what is actually meant is the number of rows/cols which define a submatrix of A, on which the operation will be applied.&lt;/P&gt;&lt;P&gt;As another proof, If I swap rows/cols in my code above, everything works for all cases!&lt;/P&gt;&lt;P&gt;I would recommend you to reword the documentation to avoid confusion for other users.&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;Denis.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Dec 2018 17:26:33 GMT</pubDate>
    <dc:creator>davydden1</dc:creator>
    <dc:date>2018-12-05T17:26:33Z</dc:date>
    <item>
      <title>Question about ldb in mkl_?omatcopy for transpose of column-major matrices</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171317#M28590</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I need to do out-of-place transpose of the matrix (actually I have plenty of them if various sizes/shapes). I have a question about ldb parameter in mkl_?omatcopy. Documentation says that if a matrix is in column major format and I am doing transpose, then ldb must be at least equal to number of columns in B. Is it indeed the case or it’s just a typo?&lt;/P&gt;&lt;P&gt;My matrices are stored with minimum leading dimension — number of rows for column major format. So that means I am out of luck using this function if number of columns in B is more than number of rows? That is unfortunate as I would expect this function to handle such cases internally in the best possible way.&lt;/P&gt;&lt;P&gt;Denis.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 05:10:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171317#M28590</guid>
      <dc:creator>davydden1</dc:creator>
      <dc:date>2018-12-05T05:10:54Z</dc:date>
    </item>
    <item>
      <title>On the related note, I have</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171318#M28591</link>
      <description>&lt;P&gt;On the related note, I have issues using this function on macOS for anything but square matrices (it simply does not work). Given that I store everything in column major format and the leading dimension is number of rows, I can not see where I could mis-use this function, see below, compiled with:&lt;/P&gt;&lt;P&gt;clang++ -std=c++11 &amp;nbsp;-m64 -I/opt/intel/mkl/include example.cc -o example -L/opt/intel/mkl/lib -Wl,-rpath,/opt/intel/mkl/lib -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;// compile with:
// clang++ -std=c++11  -m64 -I/opt/intel/mkl/include example.cc -o example -L/opt/intel/mkl/lib -Wl,-rpath,/opt/intel/mkl/lib -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl

#include &amp;lt;iostream&amp;gt;
#include &amp;lt;vector&amp;gt;

#include &amp;lt;mkl.h&amp;gt;

void print(const std::vector&amp;lt;double&amp;gt; &amp;amp;A, const unsigned int m, const unsigned int n)
{
  for (unsigned int i = 0; i &amp;lt; m; ++i)
    {
      for (unsigned int j = 0; j &amp;lt; n; ++j)
        std::cout &amp;lt;&amp;lt; A[i+j*m] &amp;lt;&amp;lt; " ";

      std::cout &amp;lt;&amp;lt; std::endl;
    }
}

bool compare(const std::vector&amp;lt;double&amp;gt; &amp;amp; A, const std::vector&amp;lt;double&amp;gt; &amp;amp;B, const unsigned int Am, const unsigned int An)
{
  bool ret = true;
  for (unsigned int i = 0; i &amp;lt; Am; ++i)
    for (unsigned int j = 0; j &amp;lt; An; ++j)
      ret &amp;amp;= (A[i+j*Am] == B[j+i*An]);

  return ret;
}

void test(const unsigned int m, const unsigned int n)
{
  std::cout &amp;lt;&amp;lt; "Test " &amp;lt;&amp;lt; m &amp;lt;&amp;lt; "x" &amp;lt;&amp;lt; n &amp;lt;&amp;lt; std::endl;
  const auto &amp;amp;Am = n;
  const auto &amp;amp;An = m;
  const auto &amp;amp;Bm = m;
  const auto &amp;amp;Bn = n;
  std::vector&amp;lt;double&amp;gt; A(Am*An,0.);
  std::vector&amp;lt;double&amp;gt; B(Bm*Bn,0.);

  for (unsigned int i = 0; i &amp;lt; Am*An; ++i)
    A&lt;I&gt; = 1+i;

  mkl_domatcopy('C', 'T', Bm, Bn, 1., A.data(), Am, B.data(), Bm);

  std::cout &amp;lt;&amp;lt; "Input:" &amp;lt;&amp;lt; std::endl;
  print(A,Am,An);
  std::cout &amp;lt;&amp;lt; "Output:" &amp;lt;&amp;lt; std::endl;
  print(B,Bm,Bn);
  std::cout &amp;lt;&amp;lt; "Correct: " &amp;lt;&amp;lt; compare(A,B,Am,An) &amp;lt;&amp;lt; std::endl&amp;lt;&amp;lt; std::endl;
}

int main(int argc, char **argv)
{
  test(11,27);
  test(15,4);
  test(10,10);
}
&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 13:46:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171318#M28591</guid>
      <dc:creator>davydden1</dc:creator>
      <dc:date>2018-12-05T13:46:39Z</dc:date>
    </item>
    <item>
      <title>We would  recommend you take</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171319#M28592</link>
      <description>&lt;P&gt;We would&amp;nbsp;&amp;nbsp;recommend you take a look at the&amp;nbsp;domatcopy.c example (mklroot\examples\transc\source\ dir)&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 16:29:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171319#M28592</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2018-12-05T16:29:00Z</dc:date>
    </item>
    <item>
      <title>Hi Gennady, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171320#M28593</link>
      <description>&lt;P&gt;Hi Gennady,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the prompt reply. I quickly translated your example to C++ and noticed the following.&amp;nbsp;The mkl_domatcopy is being called with rows=2 and cols=4 (3rd and 4th argument). However, the matrix B (which is clear both from in-code comments and its dst_stride=2) is 4x2. That is, it has 4 rows and 2 columns and is&amp;nbsp;stored in row-major format&amp;nbsp; (stride=2).&lt;/P&gt;&lt;P&gt;However the MKL documentation states:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;rows &amp;nbsp; &amp;nbsp;The number of rows in matrix&amp;nbsp;B&amp;nbsp;(the destination matrix).&lt;/P&gt;&lt;P&gt;cols &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;The number of columns in matrix&amp;nbsp;B&amp;nbsp;(the destination matrix).&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;To me this indicates&amp;nbsp;that MKL's documentation is confusing and not consistent with what is actually meant by rows/cols. Probably, what is actually meant is the number of rows/cols which define a submatrix of A, on which the operation will be applied.&lt;/P&gt;&lt;P&gt;As another proof, If I swap rows/cols in my code above, everything works for all cases!&lt;/P&gt;&lt;P&gt;I would recommend you to reword the documentation to avoid confusion for other users.&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;Denis.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 17:26:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171320#M28593</guid>
      <dc:creator>davydden1</dc:creator>
      <dc:date>2018-12-05T17:26:33Z</dc:date>
    </item>
    <item>
      <title>I have the same question.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171321#M28594</link>
      <description>&lt;P&gt;I have the same question.&lt;/P&gt;&lt;P&gt;I think the manual is wrong, the rows is the row number of destination matrix B without operation.&lt;/P&gt;&lt;P&gt;But I am not sure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;davydden wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Gennady,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the prompt reply. I quickly translated your example to C++ and noticed the following.&amp;nbsp;The mkl_domatcopy is being called with rows=2 and cols=4 (3rd and 4th argument). However, the matrix B (which is clear both from in-code comments and its dst_stride=2) is 4x2. That is, it has 4 rows and 2 columns and is&amp;nbsp;stored in row-major format&amp;nbsp; (stride=2).&lt;/P&gt;&lt;P&gt;However the MKL documentation states:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;rows &amp;nbsp; &amp;nbsp;The number of rows in matrix&amp;nbsp;B&amp;nbsp;(the destination matrix).&lt;/P&gt;&lt;P&gt;cols &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;The number of columns in matrix&amp;nbsp;B&amp;nbsp;(the destination matrix).&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;To me this indicates&amp;nbsp;that MKL's documentation is confusing and not consistent with what is actually meant by rows/cols. Probably, what is actually meant is the number of rows/cols which define a submatrix of A, on which the operation will be applied.&lt;/P&gt;&lt;P&gt;As another proof, If I swap rows/cols in my code above, everything works for all cases!&lt;/P&gt;&lt;P&gt;I would recommend you to reword the documentation to avoid confusion for other users.&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;Denis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 12:42:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171321#M28594</guid>
      <dc:creator>Ye_C_1</dc:creator>
      <dc:date>2019-02-11T12:42:00Z</dc:date>
    </item>
    <item>
      <title>Folks,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171322#M28595</link>
      <description>&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;It looks like the documentation is incorrect. I will verify with the MKL developers and get back to this thread..&lt;/P&gt;&lt;P&gt;Pamela&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 16:58:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171322#M28595</guid>
      <dc:creator>Pamela_H_Intel</dc:creator>
      <dc:date>2019-10-08T16:58:36Z</dc:date>
    </item>
    <item>
      <title>Here is the corrected info.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171323#M28596</link>
      <description>&lt;P&gt;Here is the corrected info. We will update the official documentation. Thank you for pointing out this issue!&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;According to our examples the description of parameters should be as follows:&lt;/P&gt;&lt;P&gt;rows - the number of rows in matrix A&lt;/P&gt;&lt;P&gt;cols - the number of columns in matrix A&lt;/P&gt;&lt;P&gt;alpha - this parameter scales the input matrix by&amp;nbsp;alpha.&lt;/P&gt;&lt;P&gt;a - array of size at least lda*rows in case of Row-major ordering (ordering&amp;nbsp;=&amp;nbsp;'R'). And lda*cols in case of Column-major ordering (ordering&amp;nbsp;=&amp;nbsp;'C')&lt;/P&gt;&lt;P&gt;lda - If&amp;nbsp;ordering&amp;nbsp;=&amp;nbsp;'R'&amp;nbsp;or&amp;nbsp;'r',&amp;nbsp;lda&amp;nbsp;represents the number of elements in array&amp;nbsp;a&amp;nbsp;between adjacent rows of matrix&amp;nbsp;A;&amp;nbsp;lda&amp;nbsp;must be at least equal to cols.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If&amp;nbsp;ordering&amp;nbsp;=&amp;nbsp;'C'&amp;nbsp;or&amp;nbsp;'c',&amp;nbsp;lda&amp;nbsp;represents the number of elements in array&amp;nbsp;a&amp;nbsp;between adjacent columns of matrix&amp;nbsp;A;&amp;nbsp;lda&amp;nbsp;must be at least equal to rows.&lt;/P&gt;&lt;P&gt;b&amp;nbsp;- If trans == 'R' or 'N' then it is array of size at least ldb*rows in case of Row-major ordering (ordering&amp;nbsp;=&amp;nbsp;'R'). And ldb*cols in case of Column-major ordering (ordering&amp;nbsp;=&amp;nbsp;'C').&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;If trans == 'T' or 'C' then it is array of size at least ldb*cols in case of Row-major ordering (ordering&amp;nbsp;=&amp;nbsp;'R'). And ldb*rows in case of Column-major ordering (ordering&amp;nbsp;=&amp;nbsp;'C').&lt;/P&gt;&lt;P&gt;ldb -&amp;nbsp;If&amp;nbsp;ordering&amp;nbsp;=&amp;nbsp;'R'&amp;nbsp;or&amp;nbsp;'r',&amp;nbsp;lda&amp;nbsp;represents the number of elements in array&amp;nbsp;a&amp;nbsp;between adjacent rows of matrix B;&amp;nbsp;ldb must be at least equal to cols if trans=='R' or 'N'. And rows if trans=='C' or 'T'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If&amp;nbsp;ordering&amp;nbsp;=&amp;nbsp;'C'&amp;nbsp;or&amp;nbsp;'c',&amp;nbsp;lda&amp;nbsp;represents the number of elements in array&amp;nbsp;a&amp;nbsp;between adjacent columns of matrix B; ldb&amp;nbsp;must be at least equal to rows if trans=='R' or 'N'. And cols if trans=='C' or 'T'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same changes should be applied to ?omatcopy2 routine + the following:&lt;/P&gt;&lt;P&gt;stridea -&amp;nbsp;If&amp;nbsp;ordering&amp;nbsp;=&amp;nbsp;'R'&amp;nbsp;or&amp;nbsp;'r',&amp;nbsp;stridea&amp;nbsp;represents the number of elements in array 'a'&amp;nbsp;between adjacent columns of matrix&amp;nbsp;A.&amp;nbsp;stridea&amp;nbsp;must be at least 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;If&amp;nbsp;ordering&amp;nbsp;=&amp;nbsp;'C'&amp;nbsp;or&amp;nbsp;'c',&amp;nbsp;stridea&amp;nbsp;represents the number of elements in array 'a'&amp;nbsp;between adjacent rows of matrix&amp;nbsp;A.&amp;nbsp;stridea&amp;nbsp;must be at least 1.&lt;/P&gt;&lt;P&gt;strideb -&amp;nbsp;If&amp;nbsp;ordering&amp;nbsp;=&amp;nbsp;'R'&amp;nbsp;or&amp;nbsp;'r',&amp;nbsp;strideb&amp;nbsp;represents the number of elements in array 'b'&amp;nbsp;between adjacent columns of matrix B.&amp;nbsp;strideb&amp;nbsp;must be at least 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;If&amp;nbsp;ordering&amp;nbsp;=&amp;nbsp;'C'&amp;nbsp;or&amp;nbsp;'c',&amp;nbsp;strideb&amp;nbsp;represents the number of elements in array 'b'&amp;nbsp;between adjacent rows of matrix B.&amp;nbsp;strideb&amp;nbsp;must be at least 1.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 25 Oct 2019 23:30:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-ldb-in-mkl-omatcopy-for-transpose-of-column-major/m-p/1171323#M28596</guid>
      <dc:creator>Pamela_H_Intel</dc:creator>
      <dc:date>2019-10-25T23:30:37Z</dc:date>
    </item>
  </channel>
</rss>

