1
edit
Changes
→Description
subtracting the row and column minimum
With a cilk_for reducer and a vectorized cilk_for this should have been possible, the thing is, I wrote the algorithm in such a way that instead of searching for a minimum, it searches for the location of the minimum. This turned out to be a problem when trying to parallelise it.I also tried making it just a regular number and parallelising it, but for some reason the compiler broke on the cilk_for's Here is how the parallelisation should have looked.<pre> int16_t findRowMinimum(int row) { cilk::reducer< cilk::op_min<uint16_t> > best; cilk_for (int col = 0; col < matrixSize; col++) { best->calc_min(workingCopy[row*matrixSize + col]); } return best.get_value(); }</pre> <pre> int16_t findColMinimum(int col) { cilk::reducer< cilk::op_min<uint16_t> > best; cilk_for (int row= 0; row< matrixSize; row++) { best->calc_min(workingCopy[row*matrixSize + col]); } return best.get_value(); }</pre> <pre> void subtractRowMinimum(uint16_t val, int row) { cilk_for(int col = 0; col < matrixSize; col++) { workingCopy[row*matrixSize + col] -= val; } }</pre> <pre> void subtractColMinimum(uint16_t val, int col) { cilk_for(int row = 0; row < matrixSize; row++) { workingCopy[row*matrixSize + col] -= val; } }</pre>
==Source==