<?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 MKL Distance Between Vector in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812326#M1041</link>
    <description>is there a function to sum a vector?</description>
    <pubDate>Wed, 02 Feb 2011 11:19:02 GMT</pubDate>
    <dc:creator>brachi</dc:creator>
    <dc:date>2011-02-02T11:19:02Z</dc:date>
    <item>
      <title>MKL Distance Between Vector</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812321#M1036</link>
      <description>Hi To All&lt;BR /&gt;&lt;BR /&gt;Does anybody know if the MKL contains a function tocalaulate the distance between 2 vectors.&lt;BR /&gt;&lt;BR /&gt;sqrt((x1 - y1)(x1-y1) + (x2 - y2)(x2 - y2) ........(Xn - Yn)(Xn - Yn))&lt;BR /&gt;&lt;BR /&gt;BB&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Jan 2011 11:53:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812321#M1036</guid>
      <dc:creator>brachi</dc:creator>
      <dc:date>2011-01-31T11:53:52Z</dc:date>
    </item>
    <item>
      <title>MKL Distance Between Vector</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812322#M1037</link>
      <description>The Intel MKL doesn't contain such functionality. You can try to develop your owner code and build it by the Intel Compiler with some high-level optimizations options. It would produce very good performance results.&lt;DIV&gt;--Gennady&lt;/DIV&gt;</description>
      <pubDate>Mon, 31 Jan 2011 13:03:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812322#M1037</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-01-31T13:03:16Z</dc:date>
    </item>
    <item>
      <title>MKL Distance Between Vector</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812323#M1038</link>
      <description>Hi BB,&lt;DIV&gt;i've forget to add, you can find the similarfunctionalityinto another performance library - IPP. see Signal Processingdomain: functions Sub (Subtracts the elements of two vectors) and then Sqrt (Computes a square root of each element of a vector.&lt;/DIV&gt;&lt;DIV&gt;--Gennady&lt;/DIV&gt;</description>
      <pubDate>Mon, 31 Jan 2011 13:16:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812323#M1038</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-01-31T13:16:40Z</dc:date>
    </item>
    <item>
      <title>MKL Distance Between Vector</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812324#M1039</link>
      <description>As this appears to involve 3 IPP functions (vector subtract, vector multiply, sum reduction), it may take twice as long as plain C or Fortran with a vectorizing compiler, and won't be a lot more readable even than what you would write with intrinsics in MS compiler.</description>
      <pubDate>Tue, 01 Feb 2011 10:58:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812324#M1039</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2011-02-01T10:58:18Z</dc:date>
    </item>
    <item>
      <title>MKL Distance Between Vector</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812325#M1040</link>
      <description>that is what I am tring to do I have a written code and I am tring to get it to run faster.&lt;BR /&gt;how do I use the intel compiler? hwat are the optimization options?&lt;BR /&gt;thank for your reply.</description>
      <pubDate>Wed, 02 Feb 2011 07:40:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812325#M1040</guid>
      <dc:creator>brachi</dc:creator>
      <dc:date>2011-02-02T07:40:14Z</dc:date>
    </item>
    <item>
      <title>MKL Distance Between Vector</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812326#M1041</link>
      <description>is there a function to sum a vector?</description>
      <pubDate>Wed, 02 Feb 2011 11:19:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812326#M1041</guid>
      <dc:creator>brachi</dc:creator>
      <dc:date>2011-02-02T11:19:02Z</dc:date>
    </item>
    <item>
      <title>MKL Distance Between Vector</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812327#M1042</link>
      <description>&lt;P&gt;yes. See the ?asum routines which compute the sum of magnitudes of the vector elements.&lt;/P&gt;&lt;P&gt;please refer to the &lt;A href="http://software.intel.com/en-us/articles/intel-math-kernel-library-documentation/"&gt;MKLdocumentation&lt;/A&gt;for more details.&lt;/P&gt;&lt;DIV class="section" id="Syntax_6873AD01EEED4217BFE8B33DBF995A1A"&gt;&lt;A MSHELP="http://www.microsoft.com/MSHelp/" name="Syntax_6873AD01EEED4217BFE8B33DBF995A1A"&gt;&lt;/A&gt;&lt;H2 MSHELP="http://www.microsoft.com/MSHelp/"&gt;&lt;/H2&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 02 Feb 2011 11:28:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812327#M1042</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-02-02T11:28:07Z</dc:date>
    </item>
    <item>
      <title>MKL Distance Between Vector</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812328#M1043</link>
      <description>?sum (add without taking absolute value) should work here too.&lt;BR /&gt;Since you say you want speed, plain C or Fortran code, with a vectorizing compiler, would be a better bet.&lt;BR /&gt;If you are using the current Intel C or Fortran, and haven't figured out how to use the simd reduction directive, let us know which compiler you want sample code for. Do you know Fortran ?&lt;BR /&gt;sqrt(dot_product(x-y,x-y))&lt;BR /&gt;&lt;BR /&gt;If that doesn't vectorize (requires /fp:fast), it's embarrassing, but you could then fall back on the directive.&lt;BR /&gt;If your cases are long enough for threading to be useful, and auto-parallel doesn't do the entire job, we could give you examples in openmp, or maybe someone on TBB or cilk or ArBB forum could help you, if you have chosen one of those C++ namespaces.&lt;BR /&gt;&lt;BR /&gt;(untested; show us your code)&lt;BR /&gt;sum = 0&lt;BR /&gt;!dir$ omp parallel do reduction(+: sum) private (diff) if(n&amp;gt;9999)&lt;BR /&gt;!dir$ simd reduction(+: sum)&lt;BR /&gt;do i=1,n&lt;BR /&gt; diff = x(i) - y(i)&lt;BR /&gt; sum = sum + diff**2&lt;BR /&gt;end do&lt;BR /&gt;yourresult = sqrt(sum)&lt;BR /&gt;&lt;BR /&gt;In fact, the Qparallel /Qpar-threshold0 appear to handle this better than the OpenMP and simd directives.&lt;BR /&gt;&lt;BR /&gt;In my example, when alignment is asserted, the compiler chooses only vectorization, no threading, even at par-threshold0. As the SSE2 vector code produces 4 parallel sums, which are added implicitly at the end, implementing 8 loop iterations per pass, you can see that a big data set would be needed before threading could prove beneficial.&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Feb 2011 12:21:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812328#M1043</guid>
      <dc:creator>timintel</dc:creator>
      <dc:date>2011-02-02T12:21:43Z</dc:date>
    </item>
    <item>
      <title>MKL Distance Between Vector</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812329#M1044</link>
      <description>BB&lt;BR /&gt;&lt;BR /&gt;How large is n in:&lt;BR /&gt;&lt;BR /&gt; sqrt((x1 - y1)(x1-y1) + (x2 - y2)(x2 - y2) ........(Xn - Yn)(Xn - Yn))&lt;BR /&gt;&lt;BR /&gt;How frequently is the above set differenced? (integrated)&lt;BR /&gt;&lt;BR /&gt;And how many different matched such vector differences are made?&lt;BR /&gt;&lt;BR /&gt;The answers to these questions will alter the coding strategy.&lt;BR /&gt;&lt;BR /&gt;Also is: sqrt((x1 - y1)(x1-y1) + (x2 - y2)(x2 - y2) ........(Xn - Yn)(Xn - Yn))&lt;BR /&gt;&lt;BR /&gt;Used for an absolute distance or for use in ordering distances between vector pairings? (ordering by proximity). IOW can you eliminate the ^2 and sqrt by using sum of abs?&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Feb 2011 15:56:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MKL-Distance-Between-Vector/m-p/812329#M1044</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2011-02-02T15:56:31Z</dc:date>
    </item>
  </channel>
</rss>

