mirror of
https://github.com/ROCm/ROCm.git
synced 2026-04-05 03:01:17 -04:00
Revert RBT
This commit is contained in:
@@ -12,8 +12,6 @@ printUsage() {
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -w, --wheel Creates python wheel package of bandwidth test.
|
||||
It needs to be used along with -r option"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
@@ -26,35 +24,22 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# Build environment variables. The value of test
|
||||
# root is imported from the envsetu.sh
|
||||
#
|
||||
PROJ_NAME="rocm_bandwidth_test"
|
||||
TEST_BIN_DIR="$(getBinPath)"
|
||||
TEST_NAME="rocm-bandwidth-test"
|
||||
TEST_UTILS_DIR="$(getUtilsPath)"
|
||||
TEST_SRC_DIR="$PROJ_NAME"
|
||||
TEST_SRC_DIR="rocm_bandwidth_test"
|
||||
TEST_BLD_DIR="$(getBuildPath $TEST_SRC_DIR)"
|
||||
|
||||
#
|
||||
# Env variables for packaging rocm_bandwidth_test
|
||||
#
|
||||
ROCM_PKG_PREFIX="$ROCM_INSTALL_PATH"
|
||||
TEST_PKG_ROOT="$(getPackageRoot)"
|
||||
TEST_PKG_DEB="$(getPackageRoot)/deb/$TEST_SRC_DIR"
|
||||
TEST_PKG_RPM="$(getPackageRoot)/rpm/$TEST_SRC_DIR"
|
||||
|
||||
#
|
||||
# Build the name of run script
|
||||
#
|
||||
ROCR_LIB_DIR="$(getPackageRoot)/lib"
|
||||
ROCR_INC_DIR="$(getPackageRoot)/hsa/include"
|
||||
|
||||
RUN_SCRIPT=$(echo $(basename "${BASH_SOURCE}") | sed "s/build_/run_/")
|
||||
|
||||
#
|
||||
# Specify the default build type as debug
|
||||
# DASH_JAY - Bind number of threads to use value set
|
||||
# by user in their shell config file (.bashrc)
|
||||
#
|
||||
TARGET="build"
|
||||
MAKETARGET="all"
|
||||
BUILD_TYPE="Debug"
|
||||
@@ -64,16 +49,11 @@ CLEAN_OR_OUT=0;
|
||||
PKGTYPE="deb"
|
||||
|
||||
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswo:p: --long help,clean,release,static,wheel,address_sanitizer,outdir:,package: -- "$@"`
|
||||
VALID_STR=`getopt -o hcraso:p: --long help,clean,release,static,address_sanitizer,outdir:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
#
|
||||
# Override default bindings if user specifies an option
|
||||
#
|
||||
while true ;
|
||||
do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
@@ -86,8 +66,6 @@ do
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
ack_and_skip_static ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
@@ -106,9 +84,6 @@ if [ $RET_CONFLICT -ge 30 ]; then
|
||||
exit $RET_CONFLICT
|
||||
fi
|
||||
|
||||
#
|
||||
# Clean the test build from system
|
||||
#
|
||||
clean_rocm_bandwidth_test() {
|
||||
echo "Cleaning $TEST_NAME"
|
||||
|
||||
@@ -119,16 +94,10 @@ clean_rocm_bandwidth_test() {
|
||||
rm -f $TEST_UTILS_DIR/$RUN_SCRIPT
|
||||
}
|
||||
|
||||
#
|
||||
# Build the test by runninh cmake
|
||||
#
|
||||
build_rocm_bandwidth_test() {
|
||||
|
||||
echo "Building $TEST_NAME"
|
||||
|
||||
#
|
||||
# If build directory does not exist create it
|
||||
#
|
||||
if [ ! -d "$TEST_BLD_DIR" ]; then
|
||||
mkdir -p "$TEST_BLD_DIR"
|
||||
pushd "$TEST_BLD_DIR"
|
||||
@@ -146,32 +115,22 @@ build_rocm_bandwidth_test() {
|
||||
-DADDRESS_SANITIZER="$ADDRESS_SANITIZER" \
|
||||
"$ROCM_BANDWIDTH_TEST_ROOT"
|
||||
|
||||
# Go back to the directory you came from
|
||||
popd
|
||||
fi
|
||||
|
||||
# Run the make cmd to build test
|
||||
echo "Building $TEST_NAME"
|
||||
cmake --build "$TEST_BLD_DIR" -- $MAKEARG -C $TEST_BLD_DIR
|
||||
|
||||
# Run the make cmd to install test
|
||||
echo "Installing $TEST_NAME"
|
||||
cmake --build "$TEST_BLD_DIR" -- $MAKEARG -C $TEST_BLD_DIR install
|
||||
|
||||
# Run the make cmd to package test
|
||||
echo "Packaging $TEST_NAME"
|
||||
cmake --build "$TEST_BLD_DIR" -- $MAKEARG -C $TEST_BLD_DIR package
|
||||
|
||||
# Run the copy cmd to place test in bin folder
|
||||
mkdir -p "$TEST_BIN_DIR"
|
||||
echo "Copying $TEST_NAME to $TEST_BIN_DIR"
|
||||
progressCopy "$TEST_BLD_DIR/$TEST_NAME" "$TEST_BIN_DIR"
|
||||
|
||||
# Run the copy cmd to place run script in utils folder
|
||||
mkdir -p "$TEST_UTILS_DIR"
|
||||
echo "Copying $RUN_SCRIPT to $TEST_UTILS_DIR"
|
||||
progressCopy "$SCRIPT_ROOT/$RUN_SCRIPT" "$TEST_UTILS_DIR"
|
||||
|
||||
copy_if DEB "${CPACKGEN:-"DEB;RPM"}" "$TEST_PKG_DEB" $TEST_BLD_DIR/*.deb
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$TEST_PKG_RPM" $TEST_BLD_DIR/*.rpm
|
||||
|
||||
@@ -192,7 +151,7 @@ verifyEnvSetup
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_rocm_bandwidth_test ;;
|
||||
(build) build_rocm_bandwidth_test; build_wheel "$TEST_BLD_DIR" "$PROJ_NAME" ;;
|
||||
(build) build_rocm_bandwidth_test ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user