diff --git a/bin/run_rocm_test.sh b/bin/run_rocm_test.sh index 37bc445ac..c2c570a88 100755 --- a/bin/run_rocm_test.sh +++ b/bin/run_rocm_test.sh @@ -50,8 +50,6 @@ if [ $? -eq 0 ] ; then export ISVIRT=1 fi -SKIP_USM=1 -export SKIP_USM=1 export HSA_XNACK=${HSA_XNACK:-0} # Set this flag to 1 to report error instead of warning when USM tests are being @@ -690,6 +688,20 @@ function checkrc(){ getversion echo "Included Versions: $finalvers" +# Return 1 if xnack can not be turned ON, even with HSA_XNACK=1. +# Returned value is passed to SKIP_USM env var by the caller which is +# propagated to the check script of smoke family of suites. +# Makefile.defs uses SKIP_USM env var to disable compilation and execution +# of the tests which require USM support. +function check_usm_support() { + SKIP_USM=0 + XNACK_PLUS=$(HSA_XNACK=1 rocminfo | grep -i "xnack+" | wc -l) + if [ $XNACK_PLUS -eq 0 ]; then + SKIP_USM=1 + fi + echo $SKIP_USM +} + function examples(){ # Fortran Examples mkdir -p "$resultsdir"/examples_fortran @@ -714,7 +726,7 @@ function smoke(){ # Smoke mkdir -p "$resultsdir"/smoke cd "$aompdir"/test/smoke - HIP_PATH="" AOMP_PARALLEL_SMOKE=1 CLEANUP=0 AOMPHIP=$AOMPROCM ./check_smoke.sh + SKIP_USM=$(check_usm_support) HIP_PATH="" AOMP_PARALLEL_SMOKE=1 CLEANUP=0 AOMPHIP=$AOMPROCM ./check_smoke.sh checkrc $? copyresults smoke "$aompdir"/test/smoke } @@ -724,7 +736,7 @@ function smoke-asan(){ if [ "$AOMP_SANITIZER" == 1 ]; then mkdir -p "$resultsdir"/smoke-asan cd "$aompdir"/test/smoke-asan - HIP_PATH="" AOMP_PARALLEL_SMOKE=1 CLEANUP=0 AOMPHIP=$AOMPROCM ./check_smoke_asan.sh + SKIP_USM=$(check_usm_support) HIP_PATH="" AOMP_PARALLEL_SMOKE=1 CLEANUP=0 AOMPHIP=$AOMPROCM ./check_smoke_asan.sh checkrc $? copyresults smoke-asan "$aompdir"/test/smoke-asan else @@ -738,7 +750,7 @@ function smokefails(){ if [ "$SMOKE_FAILS" == "1" ]; then mkdir -p "$resultsdir"/smoke-fails cd "$aompdir"/test/smoke-fails - ./check_smoke_fails.sh + SKIP_USM=$(check_usm_support) ./check_smoke_fails.sh checkrc $? copyresults smoke-fails else @@ -752,7 +764,7 @@ function smoke-dev(){ if [ "$SMOKE_DEV" == "1" ]; then mkdir -p "$resultsdir"/smoke-dev cd "$aompdir"/test/smoke-dev - ./check_smoke_dev.sh + SKIP_USM=$(check_usm_support) ./check_smoke_dev.sh checkrc $? copyresults smoke-dev "$aompdir"/test/smoke-dev else @@ -766,7 +778,7 @@ function smoke-limbo(){ if [ "$SMOKE_LIMBO" == "1" ]; then mkdir -p "$resultsdir"/smoke-limbo cd "$aompdir"/test/smoke-limbo - ./check_smoke_limbo.sh + SKIP_USM=$(check_usm_support) ./check_smoke_limbo.sh checkrc $? copyresults smoke-limbo "$aompdir"/test/smoke-limbo else @@ -783,7 +795,7 @@ function smoke-fort-limbo(){ if [ "$SMOKE_FORT_LIMBO" == "1" ]; then mkdir -p "$resultsdir"/smoke-fort-limbo cd "$aompdir"/test/smoke-fort-limbo - ./check_smoke_fort_limbo.sh + SKIP_USM=$(check_usm_support) ./check_smoke_fort_limbo.sh checkrc $? copyresults smoke-fort-limbo "$aompdir"/test/smoke-fort-limbo else @@ -800,7 +812,7 @@ function smoke-fort(){ if [ "$SMOKE_FORT" == "1" ]; then mkdir -p "$resultsdir"/smoke-fort cd "$aompdir"/test/smoke-fort - ./check_smoke_fort.sh + SKIP_USM=$(check_usm_support) ./check_smoke_fort.sh checkrc $? copyresults smoke-fort "$aompdir"/test/smoke-fort else @@ -849,7 +861,7 @@ function OpenMP_VV(){ echo "Skipping USM 5.x tests." SKIP_USM=1 SKIP_SOLLVE51=1 SKIP_SOLLVE52=1 ./run_OpenMP_VV.sh else - SKIP_SOLLVE51=1 SKIP_SOLLVE52=1 ./run_OpenMP_VV.sh + SKIP_USM=$(check_usm_support) SKIP_SOLLVE51=1 SKIP_SOLLVE52=1 ./run_OpenMP_VV.sh fi ./check_sollve.sh @@ -886,7 +898,7 @@ function sollve(){ echo "Skipping USM 5.0 tests." SKIP_USM=1 SKIP_SOLLVE51=1 ./run_sollve.sh else - SKIP_SOLLVE51=1 ./run_sollve.sh + SKIP_USM=$(check_usm_support) SKIP_SOLLVE51=1 ./run_sollve.sh fi ./check_sollve.sh