Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
2412 Discussions

apply parallel_reduce on two diffrent array at same loop

Sigehere_S_
Beginner
92 Views

Hi,

I am trying to apply parallel_reduce on diffrent array at a same time.

suppose :

A[]={1,2,3,4,5};

B[]={10,20,30,40,50};

i want result=(1*10 + 2*20 + 3*30 + 4*40 + 5*50)

0 Kudos
1 Reply
RafSchietekat
Black Belt
92 Views

Instead of a Range of pointers as in the examples in the Reference Manual, provide a Range of index values. In the Body or Func, have references to A and B, and use them with the current Range of index values.

Reply