Merge "tests: improve scripts on rocm v2.6, and do more check" into amd-master

[ROCm/rocprofiler commit: 6fa4f1dc66]
Tento commit je obsažen v:
Evgeny Shcherbakov
2019-08-23 15:02:06 -04:00
odevzdal Gerrit Code Review
2 změnil soubory, kde provedl 29 přidání a 10 odebrání
+28 -9
Zobrazit soubor
@@ -2,6 +2,11 @@
#-- specify the path to your rocprofiler here, ow default one will be used
ROCP_PATH=""
#-- rocm path
#-- specify the path to rocminfo here, ow default will be used
#-- default path: /opt/rocm/bin, see https://rocm.github.io/install.html
ROCM_PATH=""
#-- benchmark path
#-- the one used for cache/mem validation
PATH_CACHE_BENCH="benches/test_cache"
@@ -19,13 +24,22 @@ function initialize
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`
ELEMENT_SIZE=4 # element size in bytes of the test array (default: int/4B)
if [[ ! -z $ROCM_PATH ]]; then ROCM_PATH=$ROCM_PATH"/"; fi
#-- extract TCP size from rocminfo (delete '(*)' and space)
TCP_SIZE=`${ROCM_PATH}rocminfo | grep "L1:" | tail -n1 | \
sed 's/\([[:space:]]\|([^)]*)\)//g' | cut -f2 -d':'`
if [[ $TCP_SIZE != *KB ]]; then
printf "${RED}ERROR: 'rocminfo' failed to get L1/line sizes ... ${NC}\n"
exit
else
TCP_SIZE=`echo "${TCP_SIZE//KB}"`
fi
#-- extract cache line size from rocminfo (delete '(*)' and space)
LINE_SIZE=`${ROCM_PATH}rocminfo | grep "Cacheline Size:" | tail -n1 | \
sed 's/\([[:space:]]\|([^)]*)\)//g' | cut -f2 -d':'`
C_tcp=$(( $TCP_SIZE*1024/$ELEMENT_SIZE )) # num of items can be held
b_tcp=$(( $LINE_SIZE/$ELEMENT_SIZE )) # num of items in a line
}
#-- function to list columns in profiling file
@@ -52,8 +66,13 @@ function getColIds
function checkProfRun
{
rstfile=$1; logfile=$2
if [ ! -f $rstfile ]; then
printf "${RED}ERROR: $rstfile not generated. See $logfile ...${NC}\n"
# number of lines in the profiled .csv file (0 by default)
nlines=0
if [ -f $rstfile ]; then nlines=`wc -l $rstfile | awk '{ print $1 }'`; fi
# no .csv file generated, or no kernel data collected
if (( $nlines < 2 )); then
printf "\n${RED}ERROR: $rstfile not (correctly) generated. "
printf "See $logfile ...${NC}\n"
exit;
fi
}
@@ -80,7 +80,7 @@ function one_run
$N $s "${M}K"
${ROCP_PATH}rocprof -i ${BASE_DIR}/../pmc_config_files/cache_pmc.txt -o \
${BASE_DIR}/../$rst_file $PATH_CACHE_BENCH/cache $s $N $M \
>> $log_file
>> $log_file 2>&1
# check the profiling result
checkProfRun $rst_file $log_file