From 722bfd0a5ddb1bf2fa8c7c9aa7f228dfcbc3ba97 Mon Sep 17 00:00:00 2001 From: kjayapra-amd Date: Mon, 21 Sep 2020 21:18:25 -0400 Subject: [PATCH] SWDEV-253349 - Add a SKIP state for hip directed tests when HIP_BRINGUP_SKIP macro is used. Change-Id: If176cf775e568d4b32982127731223fe96a38f0d [ROCm/hip commit: d1f82881f6efa80d943f8c72e36385c0a7452ff8] --- projects/hip/tests/hit/HIT.cmake | 1 + projects/hip/tests/src/cg/hipCGGridGroupType.cpp | 6 +++++- .../tests/src/cg/hipCGGridGroupTypeViaBaseType.cpp | 6 +++++- .../src/cg/hipCGGridGroupTypeViaPublicApi.cpp | 6 +++++- .../hip/tests/src/cg/hipCGMultiGridGroupType.cpp | 0 projects/hip/tests/src/cg/hipCGThreadBlockType.cpp | 10 ++++++++++ .../src/cg/hipCGThreadBlockTypeViaBaseType.cpp | 10 ++++++++++ .../src/cg/hipCGThreadBlockTypeViaPublicApi.cpp | 10 ++++++++++ .../hip/tests/src/p2p/hipPeerToPeer_simple.cpp | 3 +++ .../tests/src/runtimeApi/memory/hipMemcpyDtoD.cpp | 3 +++ .../src/runtimeApi/memory/hipMemcpyDtoDAsync.cpp | 3 +++ .../tests/src/runtimeApi/memory/hipMemcpyPeer.cpp | 3 +++ .../src/runtimeApi/memory/hipMemcpyPeerAsync.cpp | 3 +++ projects/hip/tests/src/test_common.h | 14 +++++++++++++- projects/hip/tests/unit/test_common.h | 1 - 15 files changed, 74 insertions(+), 5 deletions(-) mode change 100644 => 100755 projects/hip/tests/hit/HIT.cmake mode change 100644 => 100755 projects/hip/tests/src/cg/hipCGGridGroupType.cpp mode change 100644 => 100755 projects/hip/tests/src/cg/hipCGGridGroupTypeViaBaseType.cpp mode change 100644 => 100755 projects/hip/tests/src/cg/hipCGGridGroupTypeViaPublicApi.cpp mode change 100644 => 100755 projects/hip/tests/src/cg/hipCGMultiGridGroupType.cpp mode change 100644 => 100755 projects/hip/tests/src/cg/hipCGThreadBlockType.cpp mode change 100644 => 100755 projects/hip/tests/src/cg/hipCGThreadBlockTypeViaBaseType.cpp mode change 100644 => 100755 projects/hip/tests/src/cg/hipCGThreadBlockTypeViaPublicApi.cpp mode change 100644 => 100755 projects/hip/tests/src/p2p/hipPeerToPeer_simple.cpp mode change 100644 => 100755 projects/hip/tests/src/test_common.h mode change 100644 => 100755 projects/hip/tests/unit/test_common.h diff --git a/projects/hip/tests/hit/HIT.cmake b/projects/hip/tests/hit/HIT.cmake old mode 100644 new mode 100755 index 1677d93a20..839b90befb --- a/projects/hip/tests/hit/HIT.cmake +++ b/projects/hip/tests/hit/HIT.cmake @@ -303,6 +303,7 @@ macro(MAKE_TEST _config exe) add_test(NAME ${testname} CONFIGURATIONS ${_config} COMMAND ${PROJECT_BINARY_DIR}/${exe} ${ARGN}) endif() set_tests_properties(${testname} PROPERTIES PASS_REGULAR_EXPRESSION "PASSED" ENVIRONMENT HIP_PATH=${HIP_ROOT_DIR}) + set_tests_properties(${testname} PROPERTIES SKIP_RETURN_CODE 127 ENVIRONMENT HIP_PATH=${HIP_ROOT_DIR}) endmacro() macro(MAKE_NAMED_TEST _config exe testname) diff --git a/projects/hip/tests/src/cg/hipCGGridGroupType.cpp b/projects/hip/tests/src/cg/hipCGGridGroupType.cpp old mode 100644 new mode 100755 index db45c10512..882e9fd024 --- a/projects/hip/tests/src/cg/hipCGGridGroupType.cpp +++ b/projects/hip/tests/src/cg/hipCGGridGroupType.cpp @@ -139,7 +139,11 @@ int main() if (!deviceProperties.cooperativeLaunch) { std::cout << "info: Device doesn't support cooperative launch! skipping the test!\n"; - passed(); + if (hip_skip_tests_enabled()) { + return hip_skip_retcode(); + } else { + passed(); + } return 0; } diff --git a/projects/hip/tests/src/cg/hipCGGridGroupTypeViaBaseType.cpp b/projects/hip/tests/src/cg/hipCGGridGroupTypeViaBaseType.cpp old mode 100644 new mode 100755 index 11562dfff6..29126d768c --- a/projects/hip/tests/src/cg/hipCGGridGroupTypeViaBaseType.cpp +++ b/projects/hip/tests/src/cg/hipCGGridGroupTypeViaBaseType.cpp @@ -139,7 +139,11 @@ int main() if (!deviceProperties.cooperativeLaunch) { std::cout << "info: Device doesn't support cooperative launch! skipping the test!\n"; - passed(); + if (hip_skip_tests_enabled()) { + return hip_skip_retcode(); + } else { + passed(); + } return 0; } diff --git a/projects/hip/tests/src/cg/hipCGGridGroupTypeViaPublicApi.cpp b/projects/hip/tests/src/cg/hipCGGridGroupTypeViaPublicApi.cpp old mode 100644 new mode 100755 index 21f0348aec..54de55b0c9 --- a/projects/hip/tests/src/cg/hipCGGridGroupTypeViaPublicApi.cpp +++ b/projects/hip/tests/src/cg/hipCGGridGroupTypeViaPublicApi.cpp @@ -139,7 +139,11 @@ int main() if (!deviceProperties.cooperativeLaunch) { std::cout << "info: Device doesn't support cooperative launch! skipping the test!\n"; - passed(); + if (hip_skip_tests_enabled()) { + return hip_skip_retcode(); + } else { + passed(); + } return 0; } diff --git a/projects/hip/tests/src/cg/hipCGMultiGridGroupType.cpp b/projects/hip/tests/src/cg/hipCGMultiGridGroupType.cpp old mode 100644 new mode 100755 diff --git a/projects/hip/tests/src/cg/hipCGThreadBlockType.cpp b/projects/hip/tests/src/cg/hipCGThreadBlockType.cpp old mode 100644 new mode 100755 index 4e1de9e44a..c6d54ae8c6 --- a/projects/hip/tests/src/cg/hipCGThreadBlockType.cpp +++ b/projects/hip/tests/src/cg/hipCGThreadBlockType.cpp @@ -166,6 +166,16 @@ int main() ASSERT_EQUAL(hipGetDeviceProperties(&deviceProperties, deviceId), hipSuccess); int maxThreadsPerBlock = deviceProperties.maxThreadsPerBlock; + if (!deviceProperties.cooperativeLaunch) { + std::cout << "info: Device doesn't support cooperative launch! skipping the test!\n"; + if (hip_skip_tests_enabled()) { + return hip_skip_retcode(); + } else { + passed(); + } + return 0; + } + // Test block sizes which are powers of 2 int i = 0; while (true) { diff --git a/projects/hip/tests/src/cg/hipCGThreadBlockTypeViaBaseType.cpp b/projects/hip/tests/src/cg/hipCGThreadBlockTypeViaBaseType.cpp old mode 100644 new mode 100755 index d4c9402268..ce945c727d --- a/projects/hip/tests/src/cg/hipCGThreadBlockTypeViaBaseType.cpp +++ b/projects/hip/tests/src/cg/hipCGThreadBlockTypeViaBaseType.cpp @@ -135,6 +135,16 @@ int main() ASSERT_EQUAL(hipGetDeviceProperties(&deviceProperties, deviceId), hipSuccess); int maxThreadsPerBlock = deviceProperties.maxThreadsPerBlock; + if (!deviceProperties.cooperativeLaunch) { + std::cout << "info: Device doesn't support cooperative launch! skipping the test!\n"; + if (hip_skip_tests_enabled()) { + return hip_skip_retcode(); + } else { + passed(); + } + return 0; + } + // Test block sizes which are powers of 2 int i = 0; while (true) { diff --git a/projects/hip/tests/src/cg/hipCGThreadBlockTypeViaPublicApi.cpp b/projects/hip/tests/src/cg/hipCGThreadBlockTypeViaPublicApi.cpp old mode 100644 new mode 100755 index d13e58b059..71d57b11ed --- a/projects/hip/tests/src/cg/hipCGThreadBlockTypeViaPublicApi.cpp +++ b/projects/hip/tests/src/cg/hipCGThreadBlockTypeViaPublicApi.cpp @@ -135,6 +135,16 @@ int main() ASSERT_EQUAL(hipGetDeviceProperties(&deviceProperties, deviceId), hipSuccess); int maxThreadsPerBlock = deviceProperties.maxThreadsPerBlock; + if (!deviceProperties.cooperativeLaunch) { + std::cout << "info: Device doesn't support cooperative launch! skipping the test!\n"; + if (hip_skip_tests_enabled()) { + return hip_skip_retcode(); + } else { + passed(); + } + return 0; + } + // Test block sizes which are powers of 2 int i = 0; while (true) { diff --git a/projects/hip/tests/src/p2p/hipPeerToPeer_simple.cpp b/projects/hip/tests/src/p2p/hipPeerToPeer_simple.cpp old mode 100644 new mode 100755 index 9f0982f353..13779694e2 --- a/projects/hip/tests/src/p2p/hipPeerToPeer_simple.cpp +++ b/projects/hip/tests/src/p2p/hipPeerToPeer_simple.cpp @@ -395,6 +395,9 @@ int main(int argc, char* argv[]) { if (gpuCount < 2) { printf("P2P application requires atleast 2 gpu devices\n"); + if (hip_skip_tests_enabled()) { + return hip_skip_retcode(); + } } else { if (p_tests & 0x100) { testPeerHostToDevice(false /*useAsyncCopy*/); diff --git a/projects/hip/tests/src/runtimeApi/memory/hipMemcpyDtoD.cpp b/projects/hip/tests/src/runtimeApi/memory/hipMemcpyDtoD.cpp index 7e65c47244..b3dc32810b 100755 --- a/projects/hip/tests/src/runtimeApi/memory/hipMemcpyDtoD.cpp +++ b/projects/hip/tests/src/runtimeApi/memory/hipMemcpyDtoD.cpp @@ -75,6 +75,9 @@ int main() { HIPCHECK(hipFree(Z_d)); } else { std::cout<<"Machine does not seem to have P2P Capabilities, Empty Pass"<