diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile index 36a6c3945b..283271c749 100644 --- a/.jenkins/Jenkinsfile +++ b/.jenkins/Jenkinsfile @@ -51,17 +51,19 @@ def hipBuildTest(String backendLabel) { """ } } - stage('HIP Unit Tests - HIT framework') { - dir("${WORKSPACE}/hipamd/build") { - sh """#!/usr/bin/env bash - set -x - # Check if backend label contains string "amd" or backend host is a server with amd gpu - if [[ $backendLabel =~ amd ]]; then - LLVM_PATH=/opt/rocm/llvm ctest -E 'cooperative_streams_least_capacity.tst|cooperative_streams_half_capacity.tst|cooperative_streams_full_capacity.tst|grid_group_data_sharing.tst' - else - make test - fi - """ + timeout(time: 1, unit: 'HOURS') { + stage('HIP Unit Tests - HIT framework') { + dir("${WORKSPACE}/hipamd/build") { + sh """#!/usr/bin/env bash + set -x + # Check if backend label contains string "amd" or backend host is a server with amd gpu + if [[ $backendLabel =~ amd ]]; then + LLVM_PATH=/opt/rocm/llvm ctest -E 'cooperative_streams_least_capacity.tst|cooperative_streams_half_capacity.tst|cooperative_streams_full_capacity.tst|grid_group_data_sharing.tst' + else + make test + fi + """ + } } } stage("Build - Catch2 framework") { @@ -80,9 +82,7 @@ def hipBuildTest(String backendLabel) { export HIP_RUNTIME=cuda cmake -DHIP_CATCH_TEST=1 -DHIP_PATH=\$PWD/install -DHIP_COMMON_DIR=$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install .. fi - make install -j\$(nproc) - if [[ $backendLabel =~ amd ]]; then make build_tests -j\$(nproc) else @@ -91,17 +91,19 @@ def hipBuildTest(String backendLabel) { """ } } - stage('HIP Unit Tests - Catch2 framework') { - dir("${WORKSPACE}/hipamd/build") { - sh """#!/usr/bin/env bash - set -x - # Check if backend label contains string "amd" or backend host is a server with amd gpu - if [[ $backendLabel =~ amd ]]; then - LLVM_PATH=/opt/rocm/llvm ctest -E 'Unit_hipGraphChildGraphNodeGetGraph_Functional|Unit_hipGraphExecMemcpyNodeSetParamsFromSymbol_Negative' - else - make test - fi - """ + timeout(time: 1, unit: 'HOURS') { + stage('HIP Unit Tests - Catch2 framework') { + dir("${WORKSPACE}/hipamd/build") { + sh """#!/usr/bin/env bash + set -x + # Check if backend label contains string "amd" or backend host is a server with amd gpu + if [[ $backendLabel =~ amd ]]; then + LLVM_PATH=/opt/rocm/llvm ctest -E 'Unit_hipGraphChildGraphNodeGetGraph_Functional|Unit_hipGraphExecMemcpyNodeSetParamsFromSymbol_Negative' + else + make test + fi + """ + } } } } diff --git a/tests/catch/unit/stream/hipAPIStreamDisable.cc b/tests/catch/unit/stream/hipAPIStreamDisable.cc index 4da259074b..4c6c6693da 100644 --- a/tests/catch/unit/stream/hipAPIStreamDisable.cc +++ b/tests/catch/unit/stream/hipAPIStreamDisable.cc @@ -1,5 +1,5 @@ /* -Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved. +Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights @@ -61,6 +61,7 @@ TEST_CASE("Unit_hipStreamCreate_MultistreamBasicFunctionalities") { hipAPIStreamDisableTest::NN); hipLaunchKernelGGL(HIP_KERNEL_NAME(hipAPIStreamDisableTest::nKernel), dim3(1), dim3(1), 0, 0, yd); + HIP_CHECK(hipStreamDestroy(streams[i])); } HIP_CHECK(hipMemcpy(&x, xd, sizeof(float), hipMemcpyDeviceToHost)); HIP_CHECK(hipMemcpy(&y, yd, sizeof(float), hipMemcpyDeviceToHost)); diff --git a/tests/catch/unit/stream/hipMultiStream.cc b/tests/catch/unit/stream/hipMultiStream.cc index 02db9e659c..64e4bb13b0 100644 --- a/tests/catch/unit/stream/hipMultiStream.cc +++ b/tests/catch/unit/stream/hipMultiStream.cc @@ -1,5 +1,5 @@ /* -Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved. +Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights @@ -51,6 +51,7 @@ TEST_CASE("Unit_hipMultiStream_sameDevice") { hipLaunchKernelGGL(kernel, dim3(1), dim3(1), 0, streams[i], data[i], xd, NN); hipLaunchKernelGGL(HIP_KERNEL_NAME(nKernel), dim3(1), dim3(1), 0, 0, yd); HIP_CHECK(hipFree(data[i])); + HIP_CHECK(hipStreamDestroy(streams[i])); } HIP_CHECK(hipMemcpy(&x, xd, sizeof(float), hipMemcpyDeviceToHost)); HIP_CHECK(hipMemcpy(&y, yd, sizeof(float), hipMemcpyDeviceToHost)); diff --git a/tests/src/runtimeApi/stream/hipNullStream.cpp b/tests/src/runtimeApi/stream/hipNullStream.cpp index e3ce18b366..8d0b8b16e0 100644 --- a/tests/src/runtimeApi/stream/hipNullStream.cpp +++ b/tests/src/runtimeApi/stream/hipNullStream.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved. +Copyright (c) 2015 - 2022 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights @@ -289,6 +289,9 @@ int main(int argc, char* argv[]) { HipTest::checkTest(expected_H, streamers[0]->_C_h, numElements); } + for (auto it : streamers) { + hipStreamDestroy(it->_stream); + } passed(); } diff --git a/tests/src/runtimeApi/stream/hipStreamL5.cpp b/tests/src/runtimeApi/stream/hipStreamL5.cpp index 3694fbebd3..1bdeeb8e3e 100644 --- a/tests/src/runtimeApi/stream/hipStreamL5.cpp +++ b/tests/src/runtimeApi/stream/hipStreamL5.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved. +Copyright (c) 2015 - 2022 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -121,6 +121,8 @@ void test13452() { HIPASSERT(Ah[10] == Bh[10]); HIPASSERT(Eh[10] == Dh[10] + T(1)); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -160,6 +162,8 @@ void test14523() { HIPASSERT(Ah[10] == Bh[10]); HIPASSERT(Ch[10] + T(1) == Eh[10]); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -197,6 +201,8 @@ void test15234() { HIPASSERT(Ah[10] == Bh[10]); HIPASSERT(Eh[10] == Dh[10] + T(1)); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -223,6 +229,8 @@ void test23451() { H2HAsync(Ch, Bh, size, stream); HIPCHECK(hipDeviceSynchronize()); HIPASSERT(Ah[10] + T(1) == Ch[10]); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -261,6 +269,8 @@ void test24513() { HIPASSERT(Eh[0] == Dh[0] + T(1)); HIPASSERT(Ah[0] == Ch[0]); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -300,6 +310,8 @@ void test25134() { HIPASSERT(Ah[10] == Ch[10]); HIPASSERT(Dh[10] + T(1) == Eh[10]); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -332,6 +344,8 @@ void test21345() { HIPASSERT(Bh[10] == Ch[10]); HIPASSERT(Ah[10] + T(1) == Dh[10]); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -368,6 +382,8 @@ void test34512() { HIPCHECK(hipDeviceSynchronize()); HIPASSERT(Ah[10] + T(1) == Dh[10]); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -404,6 +420,8 @@ void test35124() { HIPCHECK(hipDeviceSynchronize()); HIPASSERT(Dh[10] + T(1) == Ch[10]); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -442,6 +460,8 @@ void test31245() { HIPASSERT(Dh[10] + T(1) == Eh[10]); HIPASSERT(Bh[10] == Ch[10]); + + HIPCHECK(hipStreamDestroy(stream)); } @@ -479,6 +499,8 @@ void test32451() { HIPASSERT(Ah[10] == Ch[10]); HIPASSERT(Eh[10] + T(1) == Dh[10]); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -512,6 +534,8 @@ void test45123() { HIPCHECK(hipDeviceSynchronize()); HIPASSERT(Dh[10] + T(1) == Ch[10]); + + HIPCHECK(hipStreamDestroy(stream)); } @@ -545,6 +569,8 @@ void test41235() { HIPCHECK(hipDeviceSynchronize()); HIPASSERT(Ch[10] + T(1) == Bh[10]); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -583,6 +609,8 @@ void test42351() { HIPCHECK(hipDeviceSynchronize()); HIPASSERT(Dh[10] == Eh[10]); HIPASSERT(Ah[10] + T(1) == Ch[10]); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -617,6 +645,8 @@ void test43512() { D2H(Ch, Cd, size); HIPCHECK(hipDeviceSynchronize()); HIPASSERT(Dh[10] + T(1) == Ch[10]); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -653,6 +683,8 @@ void test51234() { HIPCHECK(hipDeviceSynchronize()); HIPASSERT(Ch[10] == Dh[10] + T(1)); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -691,6 +723,8 @@ void test52341() { HIPASSERT(Eh[10] + T(1) == Dh[10]); HIPASSERT(Ch[10] == Bh[10]); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -734,6 +768,8 @@ void test53412() { HIPASSERT(Ah[10] == Dh[10]); HIPASSERT(Eh[10] + T(1) == Fh[10]); HIPASSERT(Bh[10] == Gh[10]); + + HIPCHECK(hipStreamDestroy(stream)); } template @@ -779,6 +815,8 @@ void test54123() { HIPASSERT(Dh[10] == Ah[10]); HIPASSERT(Eh[10] == Fh[10]); HIPASSERT(Bh[10] + T(1) == Gh[10]); + + HIPCHECK(hipStreamDestroy(stream)); } int main(int argc, char* argv[]) {