Steven_Makoviac

Calculating sum of first and last column, reduce kernel

Discussion created by Steven_Makoviac on Apr 27, 2009
Latest reply on Apr 27, 2009 by gaurav.garg

Hi,

i've the following matrix:

4 5 8 9

4 5 6 1

9 6 8 7

4 8 9 8

now i want to calculate the sum of the first and the last column, 4+4+9+4+9+1+7+8

I wrote a reduce kernel but i'm not sure how i can specify the domain of execution. In the doc i found the two brook::Stream member-functions domainSize and domainOffset. I'm able to calculate the sum of the first column or the last column but how i can calculate the sum of the first and the last column?

Outcomes