Skip to content

Commit

Permalink
More gpu cpu testing (chapel-lang#26223)
Browse files Browse the repository at this point in the history
Enable nightly testing of `release/examples` in the cpu-as-device mode,
aka CHPL_GPU=cpu, on EX, by analogy to chapel-lang#26221.

While there, fix this error, which we get in CHPL_GPU=amd testing
using the bundled LLVM 18:

fact.c:17:11: error: cannot initialize a variable of type 'data *' (aka '_data *') with an rvalue of type 'void *'
   17 |     data *d = malloc(sizeof(data));
      |           ^   ~~~~~~~~~~~~~~~~~~~~

Trivial and proposed by @jabraham17. Not reviewed.
  • Loading branch information
vasslitvinov authored Nov 7, 2024
2 parents de68a25 + e48234d commit 868dbb7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions test/release/examples/primers/fact.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ int fact(int x){


data* getNewData(void){
data *d = malloc(sizeof(data));
data *d = (data*)malloc(sizeof(data));
d->x = 5;
return d;
}

data* fact_d(data *d){
data *s = malloc(sizeof(data));
data *s = (data*)malloc(sizeof(data));

if(d->x <= 1){
s->x = 1;
Expand All @@ -34,7 +34,7 @@ data* fact_d(data *d){
}

data* getDataStructPtr(void){
data *d = malloc(sizeof(data));
data *d = (data*)malloc(sizeof(data));
d->x = 10;
return d;
}
Expand Down
5 changes: 3 additions & 2 deletions util/cron/test-gpu-cpu.bash
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
#
# GPU native testing using cpu-as-device mode on a Cray CS (using none for
# CHPL_COMM)
# GPU native testing on a Cray CS
# * cpu-as-device mode
# * CHPL_COMM=none

CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
source $CWD/common-slurm-gasnet-cray-cs.bash
Expand Down
7 changes: 6 additions & 1 deletion util/cron/test-gpu-ex-cpu.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
#
# GPU native testing on a Cray EX (using none for CHPL_COMM)
# GPU native testing on a Cray EX
# * cpu-as-device mode
# * CHPL_COMM=none

CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
source $CWD/common-native-gpu.bash
Expand All @@ -10,5 +12,8 @@ export CHPL_GPU=cpu
export CHPL_COMM=none
export CHPL_GPU_NO_CPU_MODE_WARNING=y

# Test also release/examples
export CHPL_NIGHTLY_TEST_DIRS="$CHPL_NIGHTLY_TEST_DIRS release/examples"

export CHPL_NIGHTLY_TEST_CONFIG_NAME="gpu-ex-cpu"
$CWD/nightly -cron ${nightly_args}

0 comments on commit 868dbb7

Please sign in to comment.