Skip to content

Commit

Permalink
Merge pull request #68 from david-salinas/update-jenkins-for-clr-repo
Browse files Browse the repository at this point in the history
Update Jenkinsfile by adding CLR repository
  • Loading branch information
david-salinas committed Jun 13, 2023
2 parents 3645820 + f3e88e2 commit d65e8f0
Showing 1 changed file with 32 additions and 43 deletions.
75 changes: 32 additions & 43 deletions amd/hipcc/.jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,71 +15,59 @@ def hipBuildTest(String backendLabel) {
env.HIP_DIR = "${WORKSPACE}" + "/hip"
}

// Clone hipamd repository
dir("${WORKSPACE}/hipamd") {
// Clone clr repository
dir("${WORKSPACE}/clr") {
git branch: 'develop',
url: 'https://github.com/ROCm-Developer-Tools/hipamd'
env.HIPAMD_DIR = "${WORKSPACE}" + "/hipamd"
credentialsId: 'branch-credentials',
url: 'https://github.com/ROCm-Developer-Tools/clr'
env.CLR_DIR = "${WORKSPACE}" + "/clr"
}

// Clone hip-tests repository
dir("${WORKSPACE}/hip-tests") {
git branch: 'develop',
url: 'https://github.com/ROCm-Developer-Tools/hip-tests'
}
}

// 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 - HIPCC") {
// Running the build on HIPCC workspace
dir("${WORKSPACE}/HIPCC") {
sh """#!/usr/bin/env bash
set -x
rm -rf build
mkdir build
cd build/
cmake ..
make
"""
}
}

stage("BUILD HIP - ${backendLabel}") {
// Running the build on hipamd workspace
dir("${WORKSPACE}/hipamd") {
// Running the build on clr workspace
dir("${WORKSPACE}/clr") {
sh """#!/usr/bin/env bash
set -x
rm -rf build
mkdir -p build
cd build
# Check if backend label contains string "amd" or backend host is a server with amd gpu
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 -DHIPCC_BIN_DIR=\$HIPCC_DIR/bin -DCLR_BUILD_HIP=ON -DHIP_PATH=\$PWD/install -DHIP_COMMON_DIR=\$HIP_DIR -DCMAKE_PREFIX_PATH="/opt/rocm/" -DCMAKE_INSTALL_PREFIX=\$PWD/install ..
else
cmake -DHIP_PLATFORM=nvidia -DHIP_COMMON_DIR=\$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install ..
cmake -DHIPCC_BIN_DIR=\$HIPCC_DIR/bin -DCLR_BUILD_HIP=ON -DHIP_PLATFORM=nvidia -DHIP_COMMON_DIR=\$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install ..
fi
make -j\$(nproc)
make install -j\$(nproc)
"""
}
}

stage("Build - HIPCC") {
// Running the build on HIPCC workspace
dir("${WORKSPACE}/HIPCC") {
sh """#!/usr/bin/env bash
set -x
rm -rf build
mkdir build
cd build/
cmake ..
make
"""
}
}

stage("BUILD HIP TESTS - ${backendLabel}") {
// Running the build on HIP TESTS workspace
dir("${WORKSPACE}/hip-tests") {
env.HIP_PATH = "${HIPAMD_DIR}" + "/build/install"
env.HIP_PATH = "${CLR_DIR}" + "/build/install"
sh """#!/usr/bin/env bash
set -x
rm -rf build
Expand All @@ -98,20 +86,21 @@ def hipBuildTest(String backendLabel) {
}
}

stage("TEST - ${backendLabel}") {
dir("${WORKSPACE}/hip-tests") {
sh """#!/usr/bin/env bash
set -x
cd build
timeout(time: 1, unit: 'HOURS') {
stage("TEST - ${backendLabel}") {
dir("${WORKSPACE}/hip-tests") {
sh """#!/usr/bin/env bash
set -x
cd build
if [[ $backendLabel =~ amd ]]; then
ctest
ctest --overwrite BuildDirectory=. --output-junit hiptest_output_catch_amd.xml
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
"""
}
}
}

}
}

Expand Down

0 comments on commit d65e8f0

Please sign in to comment.