<?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: Need help to improve efficiency in summation of numbers in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Need-help-to-improve-efficiency-in-summation-of-numbers/m-p/901315#M11280</link>
    <description>Hey again&lt;BR /&gt;&lt;BR /&gt;I actually found by a recommandation, that by just doing a simple for-loop implementation, it is much faster than previously.&lt;BR /&gt;&lt;BR /&gt;Is it simply that I'm trying to use a function for something which it was not intended for?&lt;BR /&gt;&lt;BR /&gt;/Henrik&lt;BR /&gt;</description>
    <pubDate>Wed, 20 Aug 2008 13:16:33 GMT</pubDate>
    <dc:creator>henrikandresen</dc:creator>
    <dc:date>2008-08-20T13:16:33Z</dc:date>
    <item>
      <title>Need help to improve efficiency in summation of numbers</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Need-help-to-improve-efficiency-in-summation-of-numbers/m-p/901314#M11279</link>
      <description>Dear All&lt;BR /&gt;&lt;BR /&gt;So, a description of the setup. I have calculated a large amount of data, which can be viewed as a matrix 'V' of NxM values. I also have another matrix 'W' of the size Mx1. Both matrices are in allocated using a new double[N*M] and new double&lt;M&gt;. A part result I'm looking for is:&lt;BR /&gt;&lt;BR /&gt;result = V * W&lt;BR /&gt;&lt;BR /&gt;This gives me a vector of Nx1 values.&lt;BR /&gt;&lt;BR /&gt;If I have e.g. N = 5000 and M of 64, this takes around 20ms, which I find waaay to slow. I have implemented it using the following code, which also scales each value with another vector. Sorry in advance if the code has to be in a special box, but I can't use the insert-code-from-clipboard button.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;for( nSample = 0; nSample &amp;lt; pLine-&amp;gt;nPoints; nSample++ ){&lt;BR /&gt;	nBFPointIndex = nLine*pDataParam-&amp;gt;pitchBeamform + nSample;&lt;BR /&gt;	pDataParam-&amp;gt;pBeamform_r[nBFPointIndex] = cblas_ddot( nRcvElements, &amp;amp;(pSample_r[nSample]), pLine-&amp;gt;nPoints, &amp;amp;(pRcvWeight[nSample]), pLine-&amp;gt;nPoints );&lt;BR /&gt;	pDataParam-&amp;gt;pBeamform_r[nBFPointIndex] *= pXmtWeight[nSample];&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Is this simply a horrible implementation, or is it how I organize my data? Or is it a reasnoble amount of time for moving this data around?&lt;BR /&gt;&lt;BR /&gt;Thank you for your time&lt;BR /&gt;&lt;BR /&gt;/Henrik Andresen&lt;BR /&gt;&lt;BR /&gt;P.S. I use ver. 9.x of the MKL, so I don't have the vsMul function available, and would like not to change version at the moment. Also, it is linked using &lt;BR /&gt;the single-threaded version of the libraries if this has any influence.&lt;BR /&gt;&lt;/PRE&gt;&lt;/M&gt;</description>
      <pubDate>Wed, 20 Aug 2008 11:51:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Need-help-to-improve-efficiency-in-summation-of-numbers/m-p/901314#M11279</guid>
      <dc:creator>henrikandresen</dc:creator>
      <dc:date>2008-08-20T11:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to improve efficiency in summation of numbers</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Need-help-to-improve-efficiency-in-summation-of-numbers/m-p/901315#M11280</link>
      <description>Hey again&lt;BR /&gt;&lt;BR /&gt;I actually found by a recommandation, that by just doing a simple for-loop implementation, it is much faster than previously.&lt;BR /&gt;&lt;BR /&gt;Is it simply that I'm trying to use a function for something which it was not intended for?&lt;BR /&gt;&lt;BR /&gt;/Henrik&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Aug 2008 13:16:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Need-help-to-improve-efficiency-in-summation-of-numbers/m-p/901315#M11280</guid>
      <dc:creator>henrikandresen</dc:creator>
      <dc:date>2008-08-20T13:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to improve efficiency in summation of numbers</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Need-help-to-improve-efficiency-in-summation-of-numbers/m-p/901316#M11281</link>
      <description>A compiler with auto-vectorization and OpenMP/parallel should always be able to at least equal the performance of BLAS ?dot, although it is not a simple question when both vectorization and threading are involved. Among the advantages of writing your own loop is that many of the cases taken care of at run time by BLAS are eliminated at compile time.&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Aug 2008 14:23:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Need-help-to-improve-efficiency-in-summation-of-numbers/m-p/901316#M11281</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2008-08-20T14:23:23Z</dc:date>
    </item>
  </channel>
</rss>

