| |
|
|
| Bulletin Board
|
 |
| 22 Nov 2009 |
Correction to Targil 3 (see corrected copy)
Each instance of
BNEZ R3, L1 ; if regs[R3] != 0 branch to L1
should be
BEQZ R3, L1 ; if regs[R3] == 0 branch to L1
|
|
|
|
| 10 Jan 2010 |
Hint for Targil 8 — example of reduction
#pragma omp parallel shared(a,b) private(i,sum)
{
#pragma omp parallel for reduction(+:sum)
for (i=0; i < N; i++){
sum+ = a[i] * b[i];
}
}
Each thread has private copy of variable sum
At end of parallel for construct
Private copies of sum combined by addition
(+)
Result copied into master thread copy of sum
|
|
|
|
|
|