Skip to content

Commit

Permalink
Fix diags.chpl gpu test (add separate good file for cpu-as-device) (c…
Browse files Browse the repository at this point in the history
…hapel-lang#23698)

In a prior PR (chapel-lang#22592) I,
among other things, changed some allocations during kernel launch to use
`chpl_mem_alloc` instead of `chpl_malloc`. The effect of this is these
allocations are now being reported in our memory diagonstics log when
previously they weren't. I updated the `.good` file associated with the
`diags.chpl` to account for this but didn't account for the fact that
these newly reported allocations won't happen when using cpu-as-device.

In this PR I add a new `.cpu.good` file for when we do cpu-as-device
testing and update the `.execopts` file to be a script that will tell
start_test to use this new good file when appropriate.

[Reviewed by: nobody; update to nightly test]
  • Loading branch information
stonea authored Oct 24, 2023
2 parents 2875526 + a799762 commit 9fbd3c1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
13 changes: 13 additions & 0 deletions test/gpu/native/diags.cpu.good
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
warning: The prototype GPU support implies --no-checks. This may impact debuggability. To suppress this warning, compile with --no-checks explicitly
Start
0 (cpu): diags.chpl:nn: allocate xxB of domain(1,int(64),one) at 0xPREDIFFED
0 (cpu): diags.chpl:nn: allocate xxB of [domain(1,int(64),one)] int(64) at 0xPREDIFFED
0 (cpu): diags.chpl:nn: allocate xxB of array elements at 0xPREDIFFED
0 (cpu): diags.chpl:nn: allocate xxB of _EndCount(atomic int(64),int(64)) at 0xPREDIFFED
0 (cpu): diags.chpl:nn: free xxB of _EndCount(atomic int(64),int(64)) at 0xPREDIFFED
0 (gpu 0): diags.chpl:nn: allocate xxB of [domain(1,int(64),one)] int(64) at 0xPREDIFFED
0 (gpu 0): diags.chpl:nn: allocate xxB of array elements at 0xPREDIFFED
0 (gpu 0): diags.chpl:nn: free xxB of array elements at 0xPREDIFFED
0 (gpu 0): diags.chpl:nn: free xxB of [domain(1,int(64),one)] int(64) at 0xPREDIFFED
2 2 2 2 2 2 2 2 2 2
End
8 changes: 7 additions & 1 deletion test/gpu/native/diags.execopts
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
--memTrack
#!/usr/bin/env bash

if [[ "$CHPL_GPU" == "cpu" ]]; then
echo "--memTrack # diags.cpu.good"
else
echo "--memTrack"
fi

0 comments on commit 9fbd3c1

Please sign in to comment.