<?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 Thanks everyone for the in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002473#M18645</link>
    <description>&lt;P&gt;Thanks everyone for the comments. For the time being I'm keeping a vector called ones with sufficiently large number of 1.0's and using it with &lt;SPAN style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace;"&gt;cblas_ddot&lt;/SPAN&gt; whenever I need to sum. As the ones vector is created only once, I am okay with it.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Apr 2014 16:34:51 GMT</pubDate>
    <dc:creator>Auvi_R_</dc:creator>
    <dc:date>2014-04-28T16:34:51Z</dc:date>
    <item>
      <title>cblas_dasum is not adding up negative numbers</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002467#M18639</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am trying to get the sum of a vector using MKL's cblas_dasum function in C using Intel C++ compiler but the negative numbers are not subtracted. I would expect 40.0 + 2.0 - 42.0 == 0.0 but I am getting&amp;nbsp;40.0 + 2.0 - 42.0 == 84.0. Here is the code:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;/* compiled with  icc -mkl blastest.c -o blastest */

#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include "mkl.h"

#define N 3

int main() {
  double *v;
  v = (double *) mkl_malloc(N * sizeof( double ), 64);
  v[0] = (double) 40.0;
  v[1] = (double)  2.0;
  v[2] = (double) -42.0;
  printf("Sum  = %lf\n", cblas_dasum(N, v, 1));
  return 0;
}

&lt;/PRE&gt;

&lt;P&gt;Can anybody tell me what's wrong in the code as I am getting 84.0 as the answer.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Auvi&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Apr 2014 16:31:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002467#M18639</guid>
      <dc:creator>Auvi_R_</dc:creator>
      <dc:date>2014-04-27T16:31:21Z</dc:date>
    </item>
    <item>
      <title>Please read the manual page</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002468#M18640</link>
      <description>&lt;P&gt;Please read the manual page containing the specification of ?asum. The routines sasum, dasum return the sum of the &lt;STRONG&gt;absolute &lt;/STRONG&gt;values of the input vector array elements. The casum and zasum routines return the sum of the &lt;STRONG&gt;absolute &lt;/STRONG&gt;values of the real plus the &lt;STRONG&gt;absolute &lt;/STRONG&gt;values of the imaginary parts of the input vector array elements.&lt;/P&gt;</description>
      <pubDate>Sun, 27 Apr 2014 17:49:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002468#M18640</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2014-04-27T17:49:00Z</dc:date>
    </item>
    <item>
      <title>Thanks for opening my eyes!</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002469#M18641</link>
      <description>&lt;P&gt;Thanks for opening my eyes! This was an oversight on my part as I did download the documentation and tried to quickly locate a "sum" function. I don't see just a "dsum" function though that will work for my purpose. What is the best way to achieve this? A dot product of two vectors where one of them is just "1"s? summing up vectors is something I do all the time in other environments (numpy, MATLAB) and I'm looking for a straightforward way to achieve that in MKL.&lt;/P&gt;

&lt;P&gt;Thanks in advance,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Apr 2014 20:12:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002469#M18641</guid>
      <dc:creator>Auvi_R_</dc:creator>
      <dc:date>2014-04-27T20:12:31Z</dc:date>
    </item>
    <item>
      <title>Intel c++ offers __sec_reduce</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002470#M18642</link>
      <description>Intel c++ offers __sec_reduce_add as well as accumulate and so on. ? Sum is a common blas extension not offered by netlib or mkl.</description>
      <pubDate>Sun, 27 Apr 2014 21:56:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002470#M18642</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-04-27T21:56:53Z</dc:date>
    </item>
    <item>
      <title>Auvi, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002471#M18643</link>
      <description>&lt;P&gt;Auvi,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;mkl doesn't provide such functionality. In the case if this is "hot spot" into your application - you can use Tim's suggestion to use Cilk Plus option or&amp;nbsp; try to use another performance libraries 0 Intel(R) IPP which provides computing the sum of the elements of vectors: &amp;nbsp;ippsSum_32f and etc...&amp;nbsp; . In the case if this is not "hot spot" -- the plain code compiled by Intel Compiler would give you good results from performance point of view.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;--Gennady&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2014 10:16:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002471#M18643</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2014-04-28T10:16:41Z</dc:date>
    </item>
    <item>
      <title>My tests show no performance</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002472#M18644</link>
      <description>My tests show no performance difference among C++ STL, Cilk(tm) Plus, and plain C implementations.  A threaded MKL or IPP function might show an advantage for large enough arrays (10000?), while in-line code should be faster for small arrays (&amp;lt;500).</description>
      <pubDate>Mon, 28 Apr 2014 10:33:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002472#M18644</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-04-28T10:33:36Z</dc:date>
    </item>
    <item>
      <title>Thanks everyone for the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002473#M18645</link>
      <description>&lt;P&gt;Thanks everyone for the comments. For the time being I'm keeping a vector called ones with sufficiently large number of 1.0's and using it with &lt;SPAN style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace;"&gt;cblas_ddot&lt;/SPAN&gt; whenever I need to sum. As the ones vector is created only once, I am okay with it.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2014 16:34:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/cblas-dasum-is-not-adding-up-negative-numbers/m-p/1002473#M18645</guid>
      <dc:creator>Auvi_R_</dc:creator>
      <dc:date>2014-04-28T16:34:51Z</dc:date>
    </item>
  </channel>
</rss>

