diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile index 651bffad93..ba9161c5b2 100644 --- a/.jenkins/Jenkinsfile +++ b/.jenkins/Jenkinsfile @@ -1,6 +1,6 @@ def hipBuildTest(String backendLabel) { node(backendLabel) { - stage("Source sync ${backendLabel}") { + stage("SYNC - ${backendLabel}") { // Checkout hip repository with the PR patch dir("${WORKSPACE}/hip") { @@ -8,35 +8,25 @@ def hipBuildTest(String backendLabel) { env.HIP_DIR = "${WORKSPACE}" + "/hip" } - // Clone hipamd repository - dir("${WORKSPACE}/hipamd") { - git branch: 'develop', - url: 'https://github.com/ROCm-Developer-Tools/hipamd' - env.HIPAMD_DIR = "${WORKSPACE}" + "/hipamd" - } - + // Clone hip-tests repository dir("${WORKSPACE}/hip-tests") { git branch: 'develop', url: 'https://github.com/ROCm-Developer-Tools/hip-tests' + env.HIP_TESTS_DIR = "${WORKSPACE}" + "/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" - } + // Clone clr repository + dir("${WORKSPACE}/clr") { + git branch: 'develop', + credentialsId: 'branch-credentials', + url: 'https://github.com/ROCm-Developer-Tools/clr' + env.CLR_DIR = "${WORKSPACE}" + "/clr" } } - stage("Build - HIT framework ${backendLabel}") { - // Running the build on hipamd workspace - dir("${WORKSPACE}/hipamd") { + + stage("BUILD - HIT ${backendLabel}") { + // Running the build on clr workspace + dir("${WORKSPACE}/clr") { sh """#!/usr/bin/env bash set -x rm -rf build @@ -44,22 +34,24 @@ def hipBuildTest(String backendLabel) { cd build # Check if backend label contains string "amd" or backend host is a server with amd gpu if [[ $backendLabel =~ amd ]]; then - cmake -DHIP_CATCH_TEST=0 -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_CATCH_TEST=0 -DHIP_COMMON_DIR=$HIP_DIR -DCMAKE_PREFIX_PATH="/opt/rocm/" -DCMAKE_INSTALL_PREFIX=\$PWD/install .. else - cmake -DHIP_CATCH_TEST=0 -DHIP_PLATFORM=nvidia -DHIP_COMMON_DIR=$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install .. + cmake -DCLR_BUILD_HIP=ON -DHIP_CATCH_TEST=0 -DHIP_PLATFORM=nvidia -DHIP_COMMON_DIR=$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install .. fi - make install -j\$(nproc) + make -j\$(nproc) + make install -j\$(nproc) if [[ $backendLabel =~ amd ]]; then - make build_tests -j\$(nproc) + make build_tests -j\$(nproc) else HIP_COMPILER=nvcc HIP_PLATFORM=nvidia make build_tests -j\$(nproc) fi """ } } + timeout(time: 1, unit: 'HOURS') { - stage("HIP Unit Tests - HIT framework ${backendLabel}") { - dir("${WORKSPACE}/hipamd/build") { + stage("TEST - HIT ${backendLabel}") { + dir("${WORKSPACE}/clr/build/hipamd") { sh """#!/usr/bin/env bash set -x # Check if backend label contains string "amd" or backend host is a server with amd gpu @@ -73,28 +65,30 @@ def hipBuildTest(String backendLabel) { } } } - stage("Build - Catch2 framework") { - // Running the build on hipamd workspace - dir("${WORKSPACE}/hipamd") { + + stage("BUILD HIP - ${backendLabel}") { + // 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 -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 -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 - HIP TESTS") { + 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 @@ -112,16 +106,17 @@ def hipBuildTest(String backendLabel) { """ } } + timeout(time: 1, unit: 'HOURS') { - stage('HIP Unit Tests - Catch2 framework') { + stage("TEST - CATCH2 ${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 """ }