Update jenkinsfile to build tests against clr (#239)

* Update jenkinsfile to build tests against clr

* Update jenkinsfile

[ROCm/hip-tests commit: 61dce0f72a]
This commit is contained in:
Maneesh Gupta
2023-04-20 04:49:58 +05:30
committed by GitHub
parent e28de3dcf0
commit 85fd0dfd12
+22 -33
View File
@@ -2,53 +2,40 @@ def hipBuildTest(String backendLabel) {
node(backendLabel) { node(backendLabel) {
stage("SYNC - ${backendLabel}") { stage("SYNC - ${backendLabel}") {
// Checkout hip repository with the PR patch // Checkout hip-tests repository with the PR patch
dir("${WORKSPACE}/hip-tests") { dir("${WORKSPACE}/hip-tests") {
checkout scm checkout scm
env.HIP_TESTS_DIR = "${WORKSPACE}" + "/hip-tests" env.HIP_TESTS_DIR = "${WORKSPACE}" + "/hip-tests"
} }
// Clone HIP repository // Clone hip repository
dir("${WORKSPACE}/hip") { dir("${WORKSPACE}/hip") {
git branch: 'develop', git branch: 'develop',
url: 'https://github.com/ROCm-Developer-Tools/HIP' url: 'https://github.com/ROCm-Developer-Tools/hip'
env.HIP_DIR = "${WORKSPACE}" + "/hip" env.HIP_DIR = "${WORKSPACE}" + "/hip"
} }
// Clone hipamd repository // Clone clr repository
dir("${WORKSPACE}/hipamd") { dir("${WORKSPACE}/clr") {
git branch: 'develop', git branch: 'develop',
url: 'https://github.com/ROCm-Developer-Tools/hipamd' url: 'https://github.com/ROCm-Developer-Tools/clr'
env.HIPAMD_DIR = "${WORKSPACE}" + "/hipamd" env.CLR_DIR = "${WORKSPACE}" + "/clr"
}
// Clone vdi and opencl for only amd backend server
if (backendLabel =~ /.*amd.*/) {
dir("${WORKSPACE}/ROCm-OpenCL-Runtime") {
git branch:'develop',
url: 'https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime'
env.OPENCL_DIR = "${WORKSPACE}" + "/ROCm-OpenCL-Runtime"
}
dir("${WORKSPACE}/ROCclr") {
git branch:'develop',
url: 'https://github.com/ROCm-Developer-Tools/ROCclr'
env.ROCclr_DIR = "${WORKSPACE}" + "/ROCclr"
}
} }
} }
stage("BUILD HIP - ${backendLabel}") { stage("BUILD HIP - ${backendLabel}") {
// Running the build on hipamd workspace // Running the build on clr workspace
dir("${WORKSPACE}/hipamd") { dir("${WORKSPACE}/clr") {
sh """#!/usr/bin/env bash sh """#!/usr/bin/env bash
set -x set -x
rm -rf build
mkdir -p build mkdir -p build
cd build cd build
# Check if backend label contains string "amd" or backend host is a server with amd gpu # Check if backend label contains string "amd" or backend host is a server with amd gpu
if [[ $backendLabel =~ amd ]]; then if [[ $backendLabel =~ amd ]]; then
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 .. cmake -DCLR_BUILD_HIP=ON -DHIP_PATH=\$PWD/install -DHIP_COMMON_DIR=\$HIP_DIR -DCMAKE_PREFIX_PATH="/opt/rocm/" -DCMAKE_INSTALL_PREFIX=\$PWD/install ..
else else
cmake -DHIP_PLATFORM=nvidia -DHIP_COMMON_DIR=\$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install .. cmake -DCLR_BUILD_HIP=ON -DHIP_PLATFORM=nvidia -DHIP_COMMON_DIR=\$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install ..
fi fi
make -j\$(nproc) make -j\$(nproc)
make install -j\$(nproc) make install -j\$(nproc)
@@ -59,7 +46,7 @@ def hipBuildTest(String backendLabel) {
stage("BUILD HIP TESTS - ${backendLabel}") { stage("BUILD HIP TESTS - ${backendLabel}") {
// Running the build on HIP TESTS workspace // Running the build on HIP TESTS workspace
dir("${WORKSPACE}/hip-tests") { dir("${WORKSPACE}/hip-tests") {
env.HIP_PATH = "${HIPAMD_DIR}" + "/build/install" env.HIP_PATH = "${CLR_DIR}" + "/build/install"
sh """#!/usr/bin/env bash sh """#!/usr/bin/env bash
set -x set -x
rm -rf build rm -rf build
@@ -78,17 +65,19 @@ def hipBuildTest(String backendLabel) {
} }
} }
stage("TEST - ${backendLabel}") { timeout(time: 1, unit: 'HOURS') {
dir("${WORKSPACE}/hip-tests") { stage("TEST - ${backendLabel}") {
sh """#!/usr/bin/env bash dir("${WORKSPACE}/hip-tests") {
set -x sh """#!/usr/bin/env bash
cd build set -x
cd build
if [[ $backendLabel =~ amd ]]; then if [[ $backendLabel =~ amd ]]; then
ctest ctest --overwrite BuildDirectory=. --output-junit hiptest_output_catch_amd.xml
else else
ctest -E 'Unit_hipMemcpyHtoD_Positive_Synchronization_Behavior|Unit_hipMemcpy_Positive_Synchronization_Behavior|Unit_hipFreeNegativeHost' ctest --overwrite BuildDirectory=. --output-junit hiptest_output_catch_nvidia.xml -E 'Unit_hipMemcpyHtoD_Positive_Synchronization_Behavior|Unit_hipMemcpy_Positive_Synchronization_Behavior|Unit_hipFreeNegativeHost'
fi fi
""" """
}
} }
} }
} }