Files
rocm-systems/test/memory_validation/run_scripts/global.cfg
T
Xianwei Zhang 87e46dde4e tests: make tests print msg and exit on errors
Change-Id: Ie5af942551a6970a7414c30988a47ed57a9baf27
2019-07-23 17:18:54 -04:00

61 wiersze
1.5 KiB
INI

#-- profiler path
#-- specify the path to your rocprofiler here, ow default one will be used
ROCP_PATH=""
#-- benchmark path
#-- the one used for cache/mem validation
PATH_CACHE_BENCH="benches/test_cache"
#-- colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
#-- function to do some initializations
function initialize
{
cd ${BASE_DIR}/../$PATH_CACHE_BENCH/
# Build the benchmark
make
cd ${BASE_DIR}/../
ELEMENT_SIZE=4
#-- extract TCP parameters from rocminfo
TCP_SIZE=`rocminfo | grep "L1:" | tail -n1 | awk '{print $NF}'`
LINE_SIZE=`rocminfo | grep "Cacheline Size:" | tail -n1 | awk '{print $NF}'`
if [[ $TCP_SIZE == *KB ]]; then TCP_SIZE=`echo "${TCP_SIZE//KB}"`; fi
C_tcp=`echo "$TCP_SIZE*1024/$ELEMENT_SIZE" | bc`
b_tcp=`echo "$LINE_SIZE/$ELEMENT_SIZE" | bc`
}
#-- function to list columns in profiling file
function getColIds
{
local file=$1
local counterline=`head -n1 $file`
IFS=',' read -ra CARR <<< "$counterline"
local colIds=""
for srch in $headers
do
local colId=1
for ele in "${CARR[@]}"; do
if [[ $srch == $ele ]]; then break; fi
colId=$(( $colId+1 ))
done
colIds=$colIds" "$colId"|$srch"
done
echo $colIds
}
# check to make sure the profiling file has been generated
function checkProfRun
{
rstfile=$1; logfile=$2
if [ ! -f $rstfile ]; then
printf "${RED}ERROR: $rstfile not generated. See $logfile ...${NC}\n"
exit;
fi
}