Skip to content

Commit

Permalink
Update worksharing tests to avoid reduction
Browse files Browse the repository at this point in the history
To avoid a bug when running with CHPL_GPU=amd.  We have a separate GH issue to
track that (#22736).

---
Signed-off-by: Andy Stone <[email protected]>
  • Loading branch information
stonea committed Jul 21, 2023
1 parent c17837f commit 98f7850
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 8 additions & 2 deletions test/gpu/native/multiGPU/worksharing.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,14 @@ assert(nLaunch == here.gpus.size*numIters);

writeln(A);

if validate then
assert(n*(1+alpha*2) == + reduce A);
if validate {
// Reduction done "manually" due to this bug:
// https://github.com/chapel-lang/chapel/issues/22736
var AReduce = 0;
for a in A do AReduce += a;

assert(n*(1+alpha*2) == AReduce);
}

if printStats {
writeln("Performance (GB/s) = ", 3* numBytes(int) * n * 1e-9 / minTime );
Expand Down
6 changes: 5 additions & 1 deletion test/gpu/native/multiGPU/worksharingBasic.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ writeln(A);
const nLaunch = getGpuDiagnostics().kernel_launch;

assert(nLaunch == here.gpus.size);
assert((+ reduce A) == n);
// Reduction done "manually" due to this bug:
// https://github.com/chapel-lang/chapel/issues/22736
var AReduce = 0;
for a in A do AReduce += a;
assert(AReduce == n);

0 comments on commit 98f7850

Please sign in to comment.