Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[run_rocm_test] Check XNACK status before testing USM tests #1232

Open
wants to merge 1 commit into
base: aomp-dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions bin/run_rocm_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down