Skip to content

Commit

Permalink
Merge pull request #220 from rise-lang/barrier-tests-from-lift
Browse files Browse the repository at this point in the history
Port barrier tests from Lift
  • Loading branch information
Bastacyclop authored Feb 17, 2022
2 parents 53ad1dd + 3b1c02b commit cfa3a1b
Show file tree
Hide file tree
Showing 3 changed files with 631 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ object AdjustArraySizesForAllocations {

case Map(_, _, _, _, _, a) => visitAndGatherInformation(a, parallInfo)

// TODO: think more about these two, what about the indices?
case Gather(_, _, _, indices, a) => visitAndGatherInformation(a, parallInfo)
case Scatter(_, _, _, indices, a) => visitAndGatherInformation(a, parallInfo)

case pattern => throw new Exception(s"this should not happen for now: $pattern")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ object InsertMemoryBarriers {
collectWrites(a, allocs, writes); collectWrites(b, allocs, writes)
case TakeAcc(_, _, _, a) => collectWrites(a, allocs, writes)
case TransposeAcc(_, _, _, a) => collectWrites(a, allocs, writes)
// TODO: collect reads in indices?
case ScatterAcc(_, _, _, indices, a) =>
/* collectReads(indices, allocs, reads); */ collectWrites(a, allocs, writes)
case UnzipAcc(_, _, _, a) => collectWrites(a, allocs, writes)
case _ => throw new Exception(s"did not expect $a")
}
}
Expand Down
Loading

0 comments on commit cfa3a1b

Please sign in to comment.