Skip to content

Commit cd7e40f

Browse files
Merge pull request #66 from david-salinas/develop-update-jenkins-for-hip-tests
Update Jenkinsfile to account for HIP tests moving to hip-tests repo
2 parents 49ab7a6 + 15d35cd commit cd7e40f

File tree

1 file changed

+41
-18
lines changed

1 file changed

+41
-18
lines changed

amd/hipcc/.jenkins/Jenkinsfile

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ def hipBuildTest(String backendLabel) {
1919
dir("${WORKSPACE}/hipamd") {
2020
git branch: 'develop',
2121
url: 'https://github.com/ROCm-Developer-Tools/hipamd'
22+
env.HIPAMD_DIR = "${WORKSPACE}" + "/hipamd"
23+
}
24+
25+
// Clone hip-tests repository
26+
dir("${WORKSPACE}/hip-tests") {
27+
git branch: 'develop',
28+
url: 'https://github.com/ROCm-Developer-Tools/hip-tests'
2229
}
2330

2431
// Clone vdi and opencl for only amd backend server
@@ -36,6 +43,25 @@ def hipBuildTest(String backendLabel) {
3643
}
3744
}
3845

46+
stage("BUILD HIP - ${backendLabel}") {
47+
// Running the build on hipamd workspace
48+
dir("${WORKSPACE}/hipamd") {
49+
sh """#!/usr/bin/env bash
50+
set -x
51+
mkdir -p build
52+
cd build
53+
# Check if backend label contains string "amd" or backend host is a server with amd gpu
54+
if [[ $backendLabel =~ amd ]]; then
55+
cmake -DHIP_PATH=\$PWD/install -DHIP_COMMON_DIR=\$HIP_DIR -DAMD_OPENCL_PATH=\$OPENCL_DIR -DROCCLR_PATH=\$ROCclr_DIR -DCMAKE_PREFIX_PATH="/opt/rocm/" -DCMAKE_INSTALL_PREFIX=\$PWD/install ..
56+
else
57+
cmake -DHIP_PLATFORM=nvidia -DHIP_COMMON_DIR=\$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install ..
58+
fi
59+
make -j\$(nproc)
60+
make install -j\$(nproc)
61+
"""
62+
}
63+
}
64+
3965
stage("Build - HIPCC") {
4066
// Running the build on HIPCC workspace
4167
dir("${WORKSPACE}/HIPCC") {
@@ -50,45 +76,42 @@ def hipBuildTest(String backendLabel) {
5076
}
5177
}
5278

53-
stage("Build - Catch2 framework") {
54-
// Running the build on hipamd workspace
55-
dir("${WORKSPACE}/hipamd") {
79+
stage("BUILD HIP TESTS - ${backendLabel}") {
80+
// Running the build on HIP TESTS workspace
81+
dir("${WORKSPACE}/hip-tests") {
82+
env.HIP_PATH = "${HIPAMD_DIR}" + "/build/install"
5683
sh """#!/usr/bin/env bash
5784
set -x
85+
rm -rf build
5886
mkdir -p build
5987
cd build
88+
echo "testing $HIP_PATH"
6089
# Check if backend label contains string "amd" or backend host is a server with amd gpu
6190
if [[ $backendLabel =~ amd ]]; then
62-
cmake -DHIP_CATCH_TEST=1 -DHIP_PATH=\$PWD/install -DHIPCC_BIN_DIR=\$HIPCC_DIR/build -DHIP_COMMON_DIR=\$HIP_DIR -DAMD_OPENCL_PATH=\$OPENCL_DIR -DROCCLR_PATH=\$ROCclr_DIR -DCMAKE_PREFIX_PATH="/opt/rocm/" -DCMAKE_INSTALL_PREFIX=\$PWD/install ..
91+
cmake -DHIP_PLATFORM=amd ../catch
6392
else
6493
export HIP_PLATFORM=nvidia
65-
export HIP_COMPILER=nvcc
66-
export HIP_RUNTIME=cuda
67-
cmake -DHIP_CATCH_TEST=1 -DHIP_PATH=\$PWD/install -DHIPCC_BIN_DIR=\$HIPCC_DIR/build -DHIP_COMMON_DIR=$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install ..
68-
fi
69-
make install -j\$(nproc)
70-
if [[ $backendLabel =~ amd ]]; then
71-
make build_tests -j\$(nproc)
72-
else
73-
HIP_COMPILER=nvcc HIP_PLATFORM=nvidia make build_tests -j\$(nproc)
94+
cmake -DHIP_PLATFORM=nvidia ../catch
7495
fi
96+
make -j\$(nproc) build_tests
7597
"""
7698
}
7799
}
78100

79-
stage('HIP Unit Tests - Catch2 framework') {
80-
dir("${WORKSPACE}/hipamd/build") {
101+
stage("TEST - ${backendLabel}") {
102+
dir("${WORKSPACE}/hip-tests") {
81103
sh """#!/usr/bin/env bash
82104
set -x
83-
# Check if backend label contains string "amd" or backend host is a server with amd gpu
105+
cd build
84106
if [[ $backendLabel =~ amd ]]; then
85-
LLVM_PATH=/opt/rocm/llvm ctest -E 'Unit_hiprtc_saxpy'
107+
ctest
86108
else
87-
make test
109+
ctest -E 'Unit_hipMemcpyHtoD_Positive_Synchronization_Behavior|Unit_hipMemcpy_Positive_Synchronization_Behavior|Unit_hipFreeNegativeHost'
88110
fi
89111
"""
90112
}
91113
}
114+
92115
}
93116
}
94117

0 commit comments

Comments
 (0)