<?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 Re: transposed matrix array x constant array? in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/transposed-matrix-array-x-constant-array/m-p/913229#M14612</link>
    <description>&lt;P&gt;Hello Villesamuli,&lt;/P&gt;
&lt;P&gt;I'm sorry for the delay with answer, our expert was on vacation. So his answer is&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN-LEFT: 35.4pt"&gt;&lt;FONT face="Arial" color="teal" size="2"&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: teal; FONT-FAMILY: Arial"&gt;Both casesare correct but not effective. &lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;FONT face="Arial" color="blue" size="2"&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: blue; FONT-FAMILY: Arial"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN-LEFT: 35.4pt"&gt;&lt;FONT face="Arial" color="teal" size="2"&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: teal; FONT-FAMILY: Arial"&gt;IPP Small matrix domain doesnt provide such functionality yet. &lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN-LEFT: 35.4pt"&gt;&lt;FONT face="Arial" color="teal" size="2"&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: teal; FONT-FAMILY: Arial"&gt;You might submit feature request through IPP Technical Support channel, then it will be revised at the next version planning stage.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt; Vladimir&lt;/P&gt;</description>
    <pubDate>Tue, 28 Aug 2007 19:19:41 GMT</pubDate>
    <dc:creator>Vladimir_Dudnik</dc:creator>
    <dc:date>2007-08-28T19:19:41Z</dc:date>
    <item>
      <title>transposed matrix array x constant array?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/transposed-matrix-array-x-constant-array/m-p/913228#M14611</link>
      <description>Hi there!&lt;BR /&gt;&lt;BR /&gt;In our FEM-based application we have used several IPP matrix/vector array operations for small matrices, and the results have been rewarding. But, unfortunately, I noticed that e.g. operation "transposed matrix array x constant array" is missing from release 5.2.&lt;BR /&gt;I know that "matrix array x constant array" can be handled by using "vector array x constant array", since column stride (= stride1 ) is not needed in such a (trivial) case. My question is, how to accomplish the original task when (single) matrix transpositions are involved? At the time, I have contented myself with the routine as follows:&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;&lt;FONT size="4"&gt;case 1.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt; -- &lt;/B&gt;"&lt;FONT face="Verdana" size="2"&gt;this&lt;/FONT&gt;" represents the constant array&lt;BR /&gt;&lt;B&gt; -- &lt;/B&gt;"&lt;FONT face="Verdana" size="2"&gt;ma&lt;/FONT&gt;" represents the matrix array to be transposed&lt;BR /&gt; -- "&lt;FONT size="2"&gt;&lt;FONT face="Verdana"&gt;pDst&lt;/FONT&gt;&lt;/FONT&gt;" is the resulting matrix array&lt;BR /&gt;&lt;B&gt;&lt;BR /&gt;//----------------------------------------------------------------&lt;BR /&gt;&lt;/B&gt;&lt;FONT face="Verdana" size="2"&gt;template &lt;TYPENAME t=""&gt;&lt;BR /&gt;IPPMatrixArray&lt;T&gt;&amp;amp; IPPVectorArray&lt;T&gt;::operator* (const IPPMatrixArray&lt;T&gt;&amp;amp; ma)&lt;BR /&gt;{&lt;BR /&gt; Subscript count = this-&amp;gt;NoOfVecs(), isize = ma.Size()/count, rows = ma.NoOfRows(), icols = ma.Size()/(rows*ma.NoOfSmallMatrices());&lt;BR /&gt; if ((this-&amp;gt;Size() == count) &amp;amp;&amp;amp; (count == ma.NoOfSmallMatrices())){&lt;BR /&gt;  IPPMatrixArray&lt;T&gt; *pDst = new IPPMatrixArray&lt;T&gt;(icols, rows, count);&lt;BR /&gt;  // Standard description for source matrices&lt;BR /&gt;  int src1Stride2 = sizeof(T);&lt;BR /&gt;  int src1Stride0 = (icols*rows)*sizeof(T);&lt;BR /&gt;  int src1Stride1 = icols*sizeof(T);&lt;BR /&gt;  // Standard description for destination matrices&lt;BR /&gt;  int dstStride2 = sizeof(T);&lt;BR /&gt;  int dstStride1 = rows*sizeof(T);&lt;BR /&gt;  int dstStride0 = (rows*icols)*sizeof(T);&lt;BR /&gt;  IppStatus status;&lt;BR /&gt;  T ival;&lt;BR /&gt;  //&lt;BR /&gt;  // &lt;I&gt;NOTE.&lt;/I&gt; &lt;I&gt;The following for-loop should be replaced by "transposed matrix array - constant array" operation&lt;/I&gt;&lt;BR /&gt;  //&lt;BR /&gt;  for (Subscript i = 0; i &amp;lt; count; i++){&lt;BR /&gt;   ival = this-&amp;gt;ptr&lt;I&gt;;&lt;BR /&gt;   // multiply (i+1)-th transposed single matrix by (i+1)-th constant&lt;BR /&gt;   #ifdef ETYPE_FLOAT&lt;BR /&gt;    status = ippmMul_tc_32f( &lt;BR /&gt;     ma.GetPtr()+i*isize, src1Stride1, src1Stride2, ival,&lt;BR /&gt;     pDst-&amp;gt;GetPtr()+i*isize, dstStride1, dstStride2, rows, icols );&lt;BR /&gt;   #else if ETYPE_DOUBLE&lt;BR /&gt;&amp;amp;nbs
p;    status = ippmMul_tc_64f( &lt;BR /&gt;     ma.GetPtr()+i*isize, src1Stride1, src1Stride2, ival,&lt;BR /&gt;     pDst-&amp;gt;GetPtr()+i*isize, dstStride1, dstStride2, rows, icols );&lt;BR /&gt;   #endif&lt;BR /&gt;//   if( status &amp;lt; ippStsNoErr ) {&lt;BR /&gt;//    printf( "-- error %d, %s
", status, ippGetStatusString( status ));&lt;BR /&gt;//   }&lt;BR /&gt;  }&lt;BR /&gt;  return *pDst;&lt;BR /&gt; }&lt;BR /&gt; else{&lt;BR /&gt;  if (count != ma.NoOfSmallMatrices())&lt;BR /&gt;   cerr &amp;lt;&amp;lt; "
	Fatal error in IPPVectorArray&lt;T&gt;::operator* (const IPPMatrixArray&lt;T&gt;&amp;amp;): Source array dimensions do not match!

";&lt;BR /&gt;  if (this-&amp;gt;Size() != count)&lt;BR /&gt;   cerr &amp;lt;&amp;lt; "
	Fatal error in IPPVectorArray&lt;T&gt;::operator* (const IPPMatrixArray&lt;T&gt;&amp;amp;): Left-hand side should be constant array!

";&lt;BR /&gt;  this-&amp;gt;size = 0;&lt;BR /&gt;  this-&amp;gt;no_of_vecs = 0;&lt;BR /&gt;  return (IPPMatrixArray&lt;T&gt;&amp;amp;)*this;&lt;BR /&gt; }&lt;BR /&gt;};&lt;BR /&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/I&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/TYPENAME&gt;&lt;/FONT&gt;&lt;B&gt;//----------------------------------------------------------------&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;It is yet remarkably faster than the following, simple two-step approach:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="4"&gt;&lt;B&gt;case 2.&lt;/B&gt;&lt;/FONT&gt;&lt;BR /&gt;  -- vector array x constant array, w/ "&lt;B&gt;ippmMul_vaca&lt;/B&gt;" ( = matrix array x constant array)&lt;BR /&gt;  -- matrix array transposition, w/ "&lt;B&gt;ippmTranspose_ma&lt;/B&gt;"&lt;BR /&gt;&lt;BR /&gt;The slow-down in &lt;B&gt;case 2&lt;/B&gt; was significant, I tested it with 3-by-4 matrices of array size 1000000. I think that even &lt;B&gt;case 1&lt;/B&gt; could be speeded-up, if the proper function was available. Have I missed something..? Perhaps some stride-related thing or..?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;&lt;B&gt;Villesamuli&lt;/B&gt;&lt;/I&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 10 Aug 2007 20:20:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/transposed-matrix-array-x-constant-array/m-p/913228#M14611</guid>
      <dc:creator>norppa75</dc:creator>
      <dc:date>2007-08-10T20:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: transposed matrix array x constant array?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/transposed-matrix-array-x-constant-array/m-p/913229#M14612</link>
      <description>&lt;P&gt;Hello Villesamuli,&lt;/P&gt;
&lt;P&gt;I'm sorry for the delay with answer, our expert was on vacation. So his answer is&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN-LEFT: 35.4pt"&gt;&lt;FONT face="Arial" color="teal" size="2"&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: teal; FONT-FAMILY: Arial"&gt;Both casesare correct but not effective. &lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;FONT face="Arial" color="blue" size="2"&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: blue; FONT-FAMILY: Arial"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN-LEFT: 35.4pt"&gt;&lt;FONT face="Arial" color="teal" size="2"&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: teal; FONT-FAMILY: Arial"&gt;IPP Small matrix domain doesnt provide such functionality yet. &lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN-LEFT: 35.4pt"&gt;&lt;FONT face="Arial" color="teal" size="2"&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: teal; FONT-FAMILY: Arial"&gt;You might submit feature request through IPP Technical Support channel, then it will be revised at the next version planning stage.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt; Vladimir&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2007 19:19:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/transposed-matrix-array-x-constant-array/m-p/913229#M14612</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2007-08-28T19:19:41Z</dc:date>
    </item>
  </channel>
</rss>

