<?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 Using mkl_?csrmm in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Using-mkl-csrmm/m-p/1092462#M23322</link>
    <description>&lt;P&gt;&lt;BR /&gt;
	Hello,&amp;nbsp;&lt;BR /&gt;
	&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;I have trouble getting mkl_?csrmm to output the correct answer to my program. I am wondering if I am using or inputting the correct parameters for what I want to do for the sparse routine. Any assistance would be greatly appreciated.&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include "mkl.h"

#define NNZ 8
#define M 6
#define N 2
#define K 3
/*
	This program tries to multiply :

	 [5.0  0.0  1.0]
	 [0.0  2.0  0.0]   x       [5.0  1.0]
	 [0.0  3.0  0.0]	   [2.0  2.0]
	 [0.0  0.0  1.0]	   [6.0  6.0]
	 [1.0  0.0  0.0]
	 [2.0  0.0  5.0]

*/
int main() {
	char transa = 'n';
	MKL_INT m = M;
	MKL_INT n = N;
	MKL_INT k = K;

	float alpha = 1.0;
	char matdescra[5];
	matdescra[0] = 'g';
	matdescra[3] = 'f';

	float    val[NNZ] = { 5.0, 1.0, 2.0, 3.0, 1.0, 1.0, 2.0, 5.0 };
	MKL_INT  col[NNZ] = { 1, 3, 2, 2, 3, 1, 1, 3 };
	MKL_INT  ind[7] = { 1, 3, 4, 5, 6, 7, 9 };

	float 	b&lt;K&gt;&lt;N&gt; = { { 5.0 , 1.0 },{ 2.0 , 2.0 },{ 6.0 , 6.0 } };
	MKL_INT ldb = K;
	float 	beta = 0.0;

	float  c&lt;M&gt;&lt;N&gt; = { { 0.0, 0.0 },{ 0.0, 0.0 },{ 0.0, 0.0 },{ 0.0, 0.0 },{ 0.0, 0.0 },{ 0.0, 0.0 } };
	MKL_INT ldc = M;

	mkl_scsrmm(&amp;amp;transa, &amp;amp;m, &amp;amp;n, &amp;amp;k, &amp;amp;alpha, matdescra, val, col, ind, &amp;amp;(ind[1]), &amp;amp;(b[0][0]), &amp;amp;ldb, &amp;amp;beta, &amp;amp;(c[0][0]), &amp;amp;ldc);

	int i, j;


	for (i = 0; i &amp;lt; m; i++) {
		for (j = 0; j &amp;lt; n; j++) {
			printf("\n c[%d][%d] = %7.1f", i, j, c&lt;I&gt;&lt;J&gt;);
		}
	}

	getchar();

	return 0;
}&lt;/J&gt;&lt;/I&gt;&lt;/N&gt;&lt;/M&gt;&lt;/N&gt;&lt;/K&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Feb 2017 05:33:57 GMT</pubDate>
    <dc:creator>Bounrajbanditt_K_</dc:creator>
    <dc:date>2017-02-10T05:33:57Z</dc:date>
    <item>
      <title>Using mkl_?csrmm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Using-mkl-csrmm/m-p/1092462#M23322</link>
      <description>&lt;P&gt;&lt;BR /&gt;
	Hello,&amp;nbsp;&lt;BR /&gt;
	&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;I have trouble getting mkl_?csrmm to output the correct answer to my program. I am wondering if I am using or inputting the correct parameters for what I want to do for the sparse routine. Any assistance would be greatly appreciated.&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include "mkl.h"

#define NNZ 8
#define M 6
#define N 2
#define K 3
/*
	This program tries to multiply :

	 [5.0  0.0  1.0]
	 [0.0  2.0  0.0]   x       [5.0  1.0]
	 [0.0  3.0  0.0]	   [2.0  2.0]
	 [0.0  0.0  1.0]	   [6.0  6.0]
	 [1.0  0.0  0.0]
	 [2.0  0.0  5.0]

*/
int main() {
	char transa = 'n';
	MKL_INT m = M;
	MKL_INT n = N;
	MKL_INT k = K;

	float alpha = 1.0;
	char matdescra[5];
	matdescra[0] = 'g';
	matdescra[3] = 'f';

	float    val[NNZ] = { 5.0, 1.0, 2.0, 3.0, 1.0, 1.0, 2.0, 5.0 };
	MKL_INT  col[NNZ] = { 1, 3, 2, 2, 3, 1, 1, 3 };
	MKL_INT  ind[7] = { 1, 3, 4, 5, 6, 7, 9 };

	float 	b&lt;K&gt;&lt;N&gt; = { { 5.0 , 1.0 },{ 2.0 , 2.0 },{ 6.0 , 6.0 } };
	MKL_INT ldb = K;
	float 	beta = 0.0;

	float  c&lt;M&gt;&lt;N&gt; = { { 0.0, 0.0 },{ 0.0, 0.0 },{ 0.0, 0.0 },{ 0.0, 0.0 },{ 0.0, 0.0 },{ 0.0, 0.0 } };
	MKL_INT ldc = M;

	mkl_scsrmm(&amp;amp;transa, &amp;amp;m, &amp;amp;n, &amp;amp;k, &amp;amp;alpha, matdescra, val, col, ind, &amp;amp;(ind[1]), &amp;amp;(b[0][0]), &amp;amp;ldb, &amp;amp;beta, &amp;amp;(c[0][0]), &amp;amp;ldc);

	int i, j;


	for (i = 0; i &amp;lt; m; i++) {
		for (j = 0; j &amp;lt; n; j++) {
			printf("\n c[%d][%d] = %7.1f", i, j, c&lt;I&gt;&lt;J&gt;);
		}
	}

	getchar();

	return 0;
}&lt;/J&gt;&lt;/I&gt;&lt;/N&gt;&lt;/M&gt;&lt;/N&gt;&lt;/K&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 05:33:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Using-mkl-csrmm/m-p/1092462#M23322</guid>
      <dc:creator>Bounrajbanditt_K_</dc:creator>
      <dc:date>2017-02-10T05:33:57Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Using-mkl-csrmm/m-p/1092463#M23323</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
	&lt;BR /&gt;
	I can see that problem here is in mix of parameters for 0-based and 1-based indexing.&lt;BR /&gt;
	If you're going to use 1-based indexing then you should change matrix layout to Column major, anyway I slightly modified your example to show&amp;nbsp;correct usage&amp;nbsp;for both cases.&lt;BR /&gt;
	&lt;BR /&gt;
	Best regards,&lt;BR /&gt;
	Maria&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 06:35:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Using-mkl-csrmm/m-p/1092463#M23323</guid>
      <dc:creator>MariaZh</dc:creator>
      <dc:date>2017-02-10T06:35:17Z</dc:date>
    </item>
    <item>
      <title>Thank you so much Maria!</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Using-mkl-csrmm/m-p/1092464#M23324</link>
      <description>&lt;P&gt;Thank you so much Maria! &amp;nbsp;&lt;SPAN style="font-size: 1em;"&gt;These forums are very responsive and I appreciate the help that it gives.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Feb 2017 23:59:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Using-mkl-csrmm/m-p/1092464#M23324</guid>
      <dc:creator>Bounrajbanditt_K_</dc:creator>
      <dc:date>2017-02-12T23:59:06Z</dc:date>
    </item>
  </channel>
</rss>

