From 98f7850537c9ef0211979066ed4115e2d31a1900 Mon Sep 17 00:00:00 2001 From: Andy Stone Date: Thu, 20 Jul 2023 23:37:36 -0500 Subject: [PATCH] Update worksharing tests to avoid reduction To avoid a bug when running with CHPL_GPU=amd. We have a separate GH issue to track that (https://github.com/chapel-lang/chapel/issues/22736). --- Signed-off-by: Andy Stone --- test/gpu/native/multiGPU/worksharing.chpl | 10 ++++++++-- test/gpu/native/multiGPU/worksharingBasic.chpl | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/test/gpu/native/multiGPU/worksharing.chpl b/test/gpu/native/multiGPU/worksharing.chpl index c41120aa391b..5f1e88774180 100644 --- a/test/gpu/native/multiGPU/worksharing.chpl +++ b/test/gpu/native/multiGPU/worksharing.chpl @@ -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 ); diff --git a/test/gpu/native/multiGPU/worksharingBasic.chpl b/test/gpu/native/multiGPU/worksharingBasic.chpl index 9dfedeba39a5..dcac944e4eab 100644 --- a/test/gpu/native/multiGPU/worksharingBasic.chpl +++ b/test/gpu/native/multiGPU/worksharingBasic.chpl @@ -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);