<?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 Fabio,  in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameter-double-mat-to-cblas-dgemm/m-p/1054483#M21348</link>
    <description>&lt;P&gt;Hi Fabio,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;is the pointer of double **mat &amp;nbsp;point to a continuous memory? &amp;nbsp; If yes, then you don't need to change, &amp;nbsp;just feed the cblas_dgemm&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;with&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;cblas_dgemm(&amp;amp;m[0][0], &amp;nbsp;...)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;it should be ok&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Best &amp;nbsp;Regards,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Ying&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Here is one sample:&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp; &amp;nbsp; A = (double *)mkl_malloc( m*k*sizeof( double ), 64 );&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE&gt;    B = (double *)mkl_malloc( k*n*sizeof( double ), 64 );
    C = (double *)mkl_malloc( m*n*sizeof( double ), 64 );
    if (A == NULL || B == NULL || C == NULL) {
      printf( "\n ERROR: Can't allocate memory for matrices. Aborting... \n\n");
      mkl_free(A);
      mkl_free(B);
      mkl_free(C);
      return 1;
    }

    printf (" Intializing matrix data \n\n");
    for (i = 0; i &amp;lt; (m*k); i++) {
        A&lt;I&gt; = (double)(i+1);
    }

    for (i = 0; i &amp;lt; (k*n); i++) {
        B&lt;I&gt; = (double)(-i-1);
    }

    for (i = 0; i &amp;lt; (m*n); i++) {
        C&lt;I&gt; = 0.0;
    }

    printf (" Computing matrix product using Intel® MKL dgemm function via CBLAS interface \n\n");
    cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, 
                m, n, k, alpha, A, k, B, n, beta, C, n);&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 17 Aug 2015 02:24:31 GMT</pubDate>
    <dc:creator>Ying_H_Intel</dc:creator>
    <dc:date>2015-08-17T02:24:31Z</dc:date>
    <item>
      <title>Parameter double **mat to cblas_dgemm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameter-double-mat-to-cblas-dgemm/m-p/1054481#M21346</link>
      <description>&lt;P&gt;Dear Intel Forum,&lt;/P&gt;

&lt;P&gt;I am developing a molecular dynamic system with a several MKL functions, the atoms position is a&amp;nbsp; double **mat to the mkl function like cblas_dgemm. However, is necessary to convert the pointer ** to *, like:&lt;/P&gt;

&lt;P&gt;void mv(double** m,double* v)&lt;BR /&gt;
	{&lt;BR /&gt;
	int i = 0, j = 0,z = 0;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; for(i = 0; i &amp;lt; natom;i++)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(j = 0; j &amp;lt; natom;j++)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v&lt;Z&gt; = m&lt;I&gt;&lt;J&gt;; z++;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;
	}&lt;/J&gt;&lt;/I&gt;&lt;/Z&gt;&lt;/P&gt;

&lt;P&gt;Please, there is a way to use cblas_dgemm without this conversation ?&lt;/P&gt;</description>
      <pubDate>Sun, 16 Aug 2015 20:01:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameter-double-mat-to-cblas-dgemm/m-p/1054481#M21346</guid>
      <dc:creator>Fábio_A_</dc:creator>
      <dc:date>2015-08-16T20:01:34Z</dc:date>
    </item>
    <item>
      <title>No, cblas_dgemm() is simply a</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameter-double-mat-to-cblas-dgemm/m-p/1054482#M21347</link>
      <description>&lt;P&gt;No, cblas_dgemm() is simply a wrapper to dgemm() and so the data must be interoperable.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Aug 2015 21:51:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameter-double-mat-to-cblas-dgemm/m-p/1054482#M21347</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-08-16T21:51:22Z</dc:date>
    </item>
    <item>
      <title>Hi Fabio, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameter-double-mat-to-cblas-dgemm/m-p/1054483#M21348</link>
      <description>&lt;P&gt;Hi Fabio,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;is the pointer of double **mat &amp;nbsp;point to a continuous memory? &amp;nbsp; If yes, then you don't need to change, &amp;nbsp;just feed the cblas_dgemm&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;with&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;cblas_dgemm(&amp;amp;m[0][0], &amp;nbsp;...)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;it should be ok&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Best &amp;nbsp;Regards,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Ying&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Here is one sample:&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp; &amp;nbsp; A = (double *)mkl_malloc( m*k*sizeof( double ), 64 );&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE&gt;    B = (double *)mkl_malloc( k*n*sizeof( double ), 64 );
    C = (double *)mkl_malloc( m*n*sizeof( double ), 64 );
    if (A == NULL || B == NULL || C == NULL) {
      printf( "\n ERROR: Can't allocate memory for matrices. Aborting... \n\n");
      mkl_free(A);
      mkl_free(B);
      mkl_free(C);
      return 1;
    }

    printf (" Intializing matrix data \n\n");
    for (i = 0; i &amp;lt; (m*k); i++) {
        A&lt;I&gt; = (double)(i+1);
    }

    for (i = 0; i &amp;lt; (k*n); i++) {
        B&lt;I&gt; = (double)(-i-1);
    }

    for (i = 0; i &amp;lt; (m*n); i++) {
        C&lt;I&gt; = 0.0;
    }

    printf (" Computing matrix product using Intel® MKL dgemm function via CBLAS interface \n\n");
    cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, 
                m, n, k, alpha, A, k, B, n, beta, C, n);&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Aug 2015 02:24:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameter-double-mat-to-cblas-dgemm/m-p/1054483#M21348</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-08-17T02:24:31Z</dc:date>
    </item>
    <item>
      <title>Thank you for the reply.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameter-double-mat-to-cblas-dgemm/m-p/1054484#M21349</link>
      <description>&lt;P&gt;Thank you for the reply.&lt;BR /&gt;
	Is point to a continuous memory, i tried this solution, but the solution in different when i use this solution, even with Row ou Col major...&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 23:49:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameter-double-mat-to-cblas-dgemm/m-p/1054484#M21349</guid>
      <dc:creator>Fábio_A_</dc:creator>
      <dc:date>2015-10-22T23:49:41Z</dc:date>
    </item>
  </channel>
</rss>

