<?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 also you can have a look at in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Minimum-working-example-for-mkl-ddnscsr/m-p/967950#M16340</link>
    <description>&lt;P&gt;also you can have a look at the&amp;nbsp;mkl_ddnscsr example from the mkl's package:&amp;nbsp;"mkl_install_dir\examples\spblasc\source\ dconverters.c"&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2013 02:51:17 GMT</pubDate>
    <dc:creator>Gennady_F_Intel</dc:creator>
    <dc:date>2013-05-23T02:51:17Z</dc:date>
    <item>
      <title>Minimum working example for mkl_ddnscsr</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Minimum-working-example-for-mkl-ddnscsr/m-p/967948#M16338</link>
      <description>&lt;P&gt;Hi. Can anyone provide me with a minimum working example for mkl_ddnscsr? I have tried this so far&lt;/P&gt;
&lt;P&gt;[cpp]#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;#include &amp;lt;mkl.h&amp;gt;&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; MKL_INT info;&lt;BR /&gt;&amp;nbsp; MKL_INT m = 3; //Number of rows of A&lt;BR /&gt;&amp;nbsp; MKL_INT n = 4; //Number of columns of A&lt;BR /&gt;&amp;nbsp; MKL_INT nnz = 6; //Number of non zero elements&lt;BR /&gt;&amp;nbsp; MKL_INT job[6] = {0,0,1,2,nnz,1};&lt;BR /&gt;&amp;nbsp; double&amp;nbsp; *Acsr = (double *)&amp;nbsp; calloc(nnz, sizeof(double)&amp;nbsp; );&lt;BR /&gt;&amp;nbsp; MKL_INT *Aj&amp;nbsp;&amp;nbsp; = (MKL_INT *) calloc(nnz, sizeof(MKL_INT) );&lt;BR /&gt;&amp;nbsp; MKL_INT *Ai&amp;nbsp;&amp;nbsp; = (MKL_INT *) calloc(m+1, sizeof(MKL_INT) );&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; double A[3][4] = {{1.,3.,0.,0.},{0.,0.,4.,0.},{2.,5.,0.,6.}};&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; mkl_ddnscsr ( job, &amp;amp;m, &amp;amp;n, A[0], &amp;amp;m, Acsr, Aj, Ai, &amp;amp;info);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; for (int i=0; i&amp;lt; nnz; i++) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Acsr&lt;I&gt; != 0) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf( "column = %i, A = %f\n", Aj&lt;I&gt;, Acsr&lt;I&gt; );&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; for (int i=0; i&amp;lt; m+1; i++) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Ai[%i] = %i\n", i, Ai&lt;I&gt;);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; return 0;&lt;BR /&gt;}[/cpp]&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;But it returns these results&lt;/P&gt;
&lt;P&gt;[bash]column = 1, A = 1.000000&lt;BR /&gt;column = 2, A = 3.000000&lt;BR /&gt;column = 4, A = 4.000000&lt;BR /&gt;column = 1, A = 4.000000&lt;BR /&gt;column = 3, A = 2.000000&lt;BR /&gt;column = 4, A = 5.000000&lt;BR /&gt;Ai[0] = 1&lt;BR /&gt;Ai[1] = 3&lt;BR /&gt;Ai[2] = 4&lt;BR /&gt;Ai[3] = 7&lt;BR /&gt;&lt;BR /&gt;[/bash]&lt;/P&gt;
&lt;P&gt;If I play with the value for the lda I can almost get the correct result, however I believe this is as the manual suggests. I am on using Ubuntu 12.04 and Composer 2013.3.163 if that makes difference.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2013 06:41:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Minimum-working-example-for-mkl-ddnscsr/m-p/967948#M16338</guid>
      <dc:creator>Chris_W_8</dc:creator>
      <dc:date>2013-05-22T06:41:54Z</dc:date>
    </item>
    <item>
      <title>You have obtained the CSR</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Minimum-working-example-for-mkl-ddnscsr/m-p/967949#M16339</link>
      <description>&lt;P&gt;You have obtained the CSR representation of A&lt;SUP&gt;T&lt;/SUP&gt; rather than of A. The reason is that your array A, being a native 2-D array in C, is arranged in row-major order. The library routine expects column-major order, which is the order used for 2-D arrays in Fortran.&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2013 15:36:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Minimum-working-example-for-mkl-ddnscsr/m-p/967949#M16339</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2013-05-22T15:36:59Z</dc:date>
    </item>
    <item>
      <title>also you can have a look at</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Minimum-working-example-for-mkl-ddnscsr/m-p/967950#M16340</link>
      <description>&lt;P&gt;also you can have a look at the&amp;nbsp;mkl_ddnscsr example from the mkl's package:&amp;nbsp;"mkl_install_dir\examples\spblasc\source\ dconverters.c"&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2013 02:51:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Minimum-working-example-for-mkl-ddnscsr/m-p/967950#M16340</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2013-05-23T02:51:17Z</dc:date>
    </item>
    <item>
      <title>Hey great. Thanks a lot guys.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Minimum-working-example-for-mkl-ddnscsr/m-p/967951#M16341</link>
      <description>&lt;P&gt;Hey great. Thanks a lot guys. I have it working now. Both suggestions were very helpful. Now I can try to so some science. Thank you very much :-)&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2013 03:21:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Minimum-working-example-for-mkl-ddnscsr/m-p/967951#M16341</guid>
      <dc:creator>Chris_W_8</dc:creator>
      <dc:date>2013-05-23T03:21:35Z</dc:date>
    </item>
  </channel>
</rss>

