[ET Trac] [Einstein Toolkit] #2015: thorn Vectors does not provide a sum() reduction

Einstein Toolkit trac-noreply at einsteintoolkit.org
Fri Mar 10 11:43:12 CST 2017


#2015: thorn Vectors does not provide a sum() reduction
--------------------------+-------------------------------------------------
  Reporter:  rhaas        |       Owner:                     
      Type:  enhancement  |      Status:  new                
  Priority:  minor        |   Milestone:                     
 Component:  Cactus       |     Version:  development version
Resolution:               |    Keywords:  Vectors            
--------------------------+-------------------------------------------------

Comment (by eschnett):

 I would implement {{{sum}}} via a sequence of shuffle and vector-add
 instructions, where the last add can be a scalar add:
 {{{
 // assuming vector size is 4, input is s4
 t4 = __builtin_shuffle(s4, {1,0,3,2});
 s2 = s4 + t4;
 t2 = __builtin_shuffle(s4, {2,3,0,1});
 s1 = s2 + t2;
 }}}

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/2015#comment:3>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list