<?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 The original code, with in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Finding-elementwise-and-conditional-matrix-multiplication/m-p/1040247#M45727</link>
    <description>&lt;P&gt;The original code, with corrected syntax (either f66 one-line if or inserting endif) should work well, at least since SSE4, possibly with the addition of a directive such as !dir$ vector always in order to relax the constraint about exceptions.&amp;nbsp; At -O3, ifort should fix the backward loop nesting automatically.&lt;/P&gt;

&lt;P&gt;The (different) case which Jim quotes can be handled efficiently by e.g.&lt;/P&gt;

&lt;P&gt;&lt;CODE class="plain"&gt;c(i,j) = c(i,j) + a(i,j) * merge(b(i,j), 0., check(i,j))&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE class="plain"&gt;(again, SSE4 or later would help)&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Sep 2015 15:14:25 GMT</pubDate>
    <dc:creator>TimP</dc:creator>
    <dc:date>2015-09-23T15:14:25Z</dc:date>
    <item>
      <title>Finding elementwise and conditional matrix multiplication implementation with MKL</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-elementwise-and-conditional-matrix-multiplication/m-p/1040245#M45725</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I have been looking for an MKL version of elementwise matrix multiplication that works based on a condional approach.While Vmult can be used it is for only a 1D vector rather than a matrix.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Below is the code I would like to rewrite with MKL version if possible.&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;logical(log_kind) check(2000,2000)

do i=1,2000

   do j=1,2000

   if ( check(i,j) )

   c(i,j) = a(i,j) * b(i,j) 

   enddo

enddo &lt;/PRE&gt;

&lt;P&gt;I know Vmult helps, but it has no conditional operation.&lt;/P&gt;

&lt;P&gt;Is there is a conditional Vector library or elementwise matrix library.&lt;/P&gt;

&lt;P&gt;Can this be done by a combination of MKL library operations?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2015 14:47:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-elementwise-and-conditional-matrix-multiplication/m-p/1040245#M45725</guid>
      <dc:creator>aketh_t_</dc:creator>
      <dc:date>2015-09-22T14:47:54Z</dc:date>
    </item>
    <item>
      <title>If the check array has a</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-elementwise-and-conditional-matrix-multiplication/m-p/1040246#M45726</link>
      <description>&lt;P&gt;If the check array has a large number of .TRUE., then consider replacing the logical check array with an array of values 0.0 for false and 1.0 for true. Then use&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;real :: use_this(2000,2000)
...
do j=1,2000 ! outer loop to be rightmost index
   do i=1,2000 ! inner loop to be the leftmost index
       c(i,j) = c(i,j) + a(i,j) * b(i,j) * use_this(i, j)
   enddo
enddo &lt;/PRE&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2015 12:54:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-elementwise-and-conditional-matrix-multiplication/m-p/1040246#M45726</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2015-09-23T12:54:28Z</dc:date>
    </item>
    <item>
      <title>The original code, with</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-elementwise-and-conditional-matrix-multiplication/m-p/1040247#M45727</link>
      <description>&lt;P&gt;The original code, with corrected syntax (either f66 one-line if or inserting endif) should work well, at least since SSE4, possibly with the addition of a directive such as !dir$ vector always in order to relax the constraint about exceptions.&amp;nbsp; At -O3, ifort should fix the backward loop nesting automatically.&lt;/P&gt;

&lt;P&gt;The (different) case which Jim quotes can be handled efficiently by e.g.&lt;/P&gt;

&lt;P&gt;&lt;CODE class="plain"&gt;c(i,j) = c(i,j) + a(i,j) * merge(b(i,j), 0., check(i,j))&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE class="plain"&gt;(again, SSE4 or later would help)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2015 15:14:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-elementwise-and-conditional-matrix-multiplication/m-p/1040247#M45727</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-09-23T15:14:25Z</dc:date>
    </item>
  </channel>
</rss>

