<?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 Difference between C++ code with Blas/Lapack and Matlab  in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difference-between-C-code-with-Blas-Lapack-and-Matlab/m-p/1049629#M21082</link>
    <description>&lt;P&gt;Hi All!&lt;/P&gt;

&lt;P&gt;I am trying to implement one Linear programming algorithm in C++. For the matrix multiplication, I use Blas and Lapack. However, I find C++ code performs worse than Matlab as the size of problem is large. Indeed, the difference becomes significant as the size increases.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I am wondering if it is caused by the optimization tricks of matlab use to call Intel MKL. Could some one help explain why Matlab sometimes outperform C++ with Blas/Lapack? &amp;nbsp;Is there any way to improve this version of C++ code, or any option to optimize compiling?&lt;/P&gt;

&lt;P&gt;Thank you for your time!&lt;/P&gt;</description>
    <pubDate>Sun, 27 Sep 2015 07:06:23 GMT</pubDate>
    <dc:creator>Tianyi__Darren__L_</dc:creator>
    <dc:date>2015-09-27T07:06:23Z</dc:date>
    <item>
      <title>Difference between C++ code with Blas/Lapack and Matlab</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difference-between-C-code-with-Blas-Lapack-and-Matlab/m-p/1049629#M21082</link>
      <description>&lt;P&gt;Hi All!&lt;/P&gt;

&lt;P&gt;I am trying to implement one Linear programming algorithm in C++. For the matrix multiplication, I use Blas and Lapack. However, I find C++ code performs worse than Matlab as the size of problem is large. Indeed, the difference becomes significant as the size increases.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I am wondering if it is caused by the optimization tricks of matlab use to call Intel MKL. Could some one help explain why Matlab sometimes outperform C++ with Blas/Lapack? &amp;nbsp;Is there any way to improve this version of C++ code, or any option to optimize compiling?&lt;/P&gt;

&lt;P&gt;Thank you for your time!&lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2015 07:06:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difference-between-C-code-with-Blas-Lapack-and-Matlab/m-p/1049629#M21082</guid>
      <dc:creator>Tianyi__Darren__L_</dc:creator>
      <dc:date>2015-09-27T07:06:23Z</dc:date>
    </item>
    <item>
      <title>Does Matlab make affinity</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difference-between-C-code-with-Blas-Lapack-and-Matlab/m-p/1049630#M21083</link>
      <description>&lt;P&gt;Does Matlab make affinity settings?&amp;nbsp; Even if you run on a single CPU, those may improve cache locality, particularly as you prevent C++ from fusing loops as it might do if you wrote in-line code in place of level 1 BLAS calls.&lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2015 09:02:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difference-between-C-code-with-Blas-Lapack-and-Matlab/m-p/1049630#M21083</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-09-27T09:02:38Z</dc:date>
    </item>
    <item>
      <title>Hi, Tim. </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difference-between-C-code-with-Blas-Lapack-and-Matlab/m-p/1049631#M21084</link>
      <description>&lt;P&gt;Hi, Tim.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thank you for your reply!&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Would you like to tell me what affinity settings in Matlab mean? I am not familiar&amp;nbsp;with this. Furthermore, could you tell me how I modify my C++ code to improve the performance?&lt;/P&gt;

&lt;P&gt;Thank you for your time!&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2015 06:31:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difference-between-C-code-with-Blas-Lapack-and-Matlab/m-p/1049631#M21084</guid>
      <dc:creator>Tianyi__Darren__L_</dc:creator>
      <dc:date>2015-09-28T06:31:00Z</dc:date>
    </item>
    <item>
      <title>Could anyone help solve this</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difference-between-C-code-with-Blas-Lapack-and-Matlab/m-p/1049632#M21085</link>
      <description>&lt;P&gt;Could anyone help solve this problem? I am still confusing about which optimization tricks Matlab apply to Intel MKL.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2015 07:48:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difference-between-C-code-with-Blas-Lapack-and-Matlab/m-p/1049632#M21085</guid>
      <dc:creator>Tianyi__Darren__L_</dc:creator>
      <dc:date>2015-10-06T07:48:12Z</dc:date>
    </item>
    <item>
      <title>Hi Tianyi, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difference-between-C-code-with-Blas-Lapack-and-Matlab/m-p/1049633#M21086</link>
      <description>&lt;P&gt;Hi Tianyi,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Could you provide some details,&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;like a test code and test result, compile option, test processor, matlab version, MKL version &amp;nbsp;to explain what the problem you are seeing? &amp;nbsp;otherwise, it is hard to say something.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Regarding MKL and Matlab, you may have known that , Matlab matrix multiply should call MKL. You may check this by enter command in matlab command windows,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 14px; line-height: 19.6000003814697px;"&gt;version -blas&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/articles/using-intel-math-kernel-library-with-mathworks-matlab-on-intel-xeon-phi-coprocessor-system" target="_blank"&gt;https://software.intel.com/en-us/articles/using-intel-math-kernel-library-with-mathworks-matlab-on-intel-xeon-phi-coprocessor-system&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/articles/using-intel-mkl-with-matlab" target="_blank"&gt;https://software.intel.com/en-us/articles/using-intel-mkl-with-matlab&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 05:26:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difference-between-C-code-with-Blas-Lapack-and-Matlab/m-p/1049633#M21086</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-10-08T05:26:07Z</dc:date>
    </item>
    <item>
      <title>two my cents just for info --</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difference-between-C-code-with-Blas-Lapack-and-Matlab/m-p/1049634#M21087</link>
      <description>&lt;P&gt;two my cents just for info -- Matlab R2015b uses MKL version 11.1.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 06:37:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difference-between-C-code-with-Blas-Lapack-and-Matlab/m-p/1049634#M21087</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2015-10-08T06:37:43Z</dc:date>
    </item>
  </channel>
</rss>

