Refactoring part2: renamed keywords to blocksize, read, locked, private, reduction.

This commit is contained in:
Jack Yu 2021-04-25 23:23:11 -04:00
commit 64b830c7e6
2 changed files with 60 additions and 60 deletions

View file

@ -22,7 +22,7 @@ fn main() {
let numbers: Vec<Student> = vec![];
par_for! {
for i in 1..32, blocksize 4, capturing numbers, {
for i in 1..32, blocksize 4, locked numbers, {
//std::thread::sleep(
// time::Duration::from_secs(
// rand::thread_rng().gen_range(1..10)));
@ -48,7 +48,7 @@ fn main() {
for j in 0..n {
let mut x = 0;
par_for! {
for k in 0..n, using a b, reducing x#+, {
for k in 0..n, read a b, reduction x#+, {
x += a[i][k]*b[k][j];
}
}
@ -58,7 +58,7 @@ fn main() {
println!("{:?}", c);
// let mut local = 0;
// par_for! {
// for i in 1..32, blocksize 1, capturing numbers, private local, {
// for i in 1..32, blocksize 1, locked numbers, private local, {
// local += 1;
// println!("{}", local);
// let mut lock = numbers.write();