Skip to content

Commit 3bdc7cb

Browse files
author
Ruairi Moran
committed
Merge branch 'hf/28-compilation-on-orin' of github.com:GPUEngineering/GPUtils into hf/28-compilation-on-orin
2 parents 5c1ed5d + 1f4b62c commit 3bdc7cb

File tree

2 files changed

+42
-21
lines changed

2 files changed

+42
-21
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ name: Continuous integration
77

88
jobs:
99
ci:
10-
runs-on: self-hosted
10+
runs-on: ${{ matrix.runner }}
11+
strategy:
12+
matrix:
13+
runner: [orin, a40]
1114
steps:
1215
- name: checkout code
1316
uses: actions/checkout@v4

ci/script.sh

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,62 @@
11
#!/bin/bash
22
set -euxo pipefail
33

4+
45
tests() {
6+
# Where are we? (A40 or Orin?)
7+
cpp_version=17 # default
8+
sm_arch=86 # default
9+
hwInfoOrin=`lshw | grep Orin` ||
10+
if [ ! -z "${hwInfoOrin}" ]; then
11+
echo "Running on Orin";
12+
sm_arch=87
13+
cpp_version=17
14+
else
15+
echo "Not running on Orin";
16+
sm_arch=86
17+
cpp_version=20
18+
fi
19+
520
# ------------------------------------
621
# Run tensor gtests
722
# ------------------------------------
823

924
# -- create build files
10-
cmake -S . -B ./build -Wno-dev
25+
cmake -DCPPVERSION=${cpp_version} -DSM_ARCH=${sm_arch} -S . -B ./build -Wno-dev
1126

1227
# -- build files in build folder
1328
cmake --build ./build
1429

1530
# -- run tests
1631
ctest --test-dir ./build/test --output-on-failure
1732

18-
# -- run compute sanitizer
19-
cd ./build/test
20-
mem=$(/usr/local/cuda-12.3/bin/compute-sanitizer --tool memcheck --leak-check=full ./device_test)
21-
grep "0 errors" <<< "$mem"
22-
cd ../..
33+
if [ -z "${hwInfoOrin}" ]; then
2334

24-
# ------------------------------------
25-
# Run example executable
26-
# ------------------------------------
35+
# -- run compute sanitizer
36+
cd ./build/test
37+
mem=$(/usr/local/cuda/bin/compute-sanitizer --tool memcheck --leak-check=full ./device_test)
38+
grep "0 errors" <<< "$mem"
39+
cd ../..
2740

28-
# -- create build files
29-
cd example
30-
cmake -S . -B ./build -Wno-dev
41+
# ------------------------------------
42+
# Run example executable
43+
# ------------------------------------
3144

32-
# -- build files in build folder
33-
cmake --build ./build
45+
# -- create build files
46+
cd example
47+
cmake -DCPPVERSION=${cpp_version} -DSM_ARCH=${sm_arch} -S . -B ./build -Wno-dev
48+
49+
# -- build files in build folder
50+
cmake --build ./build
3451

35-
# -- run main.cu
36-
./build/example_main
52+
# -- run main.cu
53+
./build/example_main
3754

38-
# -- run compute sanitizer
39-
cd ./build
40-
mem=$(/usr/local/cuda-12.3/bin/compute-sanitizer --tool memcheck --leak-check=full ./example_main)
41-
grep "0 errors" <<< "$mem"
55+
# -- run compute sanitizer
56+
cd ./build
57+
mem=$(/usr/local/cuda/bin/compute-sanitizer --tool memcheck --leak-check=full ./example_main)
58+
grep "0 errors" <<< "$mem"
59+
fi
4260
}
4361

4462

0 commit comments

Comments
 (0)