1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
#!/usr/bin/env bash
# Copyright (C) 2022-2024 Advanced Micro Devices, Inc.
#set -eux
# benchmarks to run
# valid options are: (default will run all of them)
# syevd -> eigensolver D&C + QR algorithm (heevd in complex precision)
# syevdx -> eigensolver D&C + bisection (heevdx in complex precision)
# syevj -> eigensolver Jacobi (heevj in complex precision)
# syevjBatch -> eigensolver Jacobi batch version (heevjBatch in complex precision)
# gesvd -> SVD QR algorithm
# gesvdj -> SVD Jacobi
# gesvdjBatch -> SVD Jacobi batch version
# potrf -> Cholesky factorization
# potrfBatch -> Cholesky factorization batch version
# geqrf -> Orthogonal factorization
# (note: several can be selected)
Slist="syevd syevdx syevj syevjBatch gesvd gesvdj gesvdjBatch potrf potrfBatch geqrf"
# precisions to use
# valid options are: (default is d)
# s -> real single precision
# d -> real double precision
# c -> complex single precision
# z -> complex double precision
# (note: several can be selected)
Plist="s d c z"
# size cases to run:
# valid options are: (default is large)
# small -> see definitions in rocsolver-perfoptim-suite.py for included size values
# medium -> see definitions in rocsolver-perfoptim-suite.py for included size values
# large -> see definitions in rocsolver-perfoptim-suite.py for included size values
# (note: select only one as small is a sub-set of medium which is a sub-set of large)
Clist="small medium large"
# Get and validate input arguments:
error=true
havecase=false
suite=""
precision=""
case=""
if [ $# == 0 ]; then
error=false
suite=$Slist
precision="d"
case="large"
else
args=$@
for a in $args; do
for s in $Slist; do
if [ $a == $s ]; then
new=true
error=false
for ss in $suite; do
if [ $a == $ss ]; then
new=false
break
fi
done
if $new; then
suite+="$s "
fi
break
fi
done
for p in $Plist; do
if [ $a == $p ]; then
new=true
error=false
for pp in $precision; do
if [ $a == $pp ]; then
new=false
break
fi
done
if $new; then
precision+="$p "
fi
break
fi
done
for c in $Clist; do
if [ $a == $c ]; then
if $havecase; then
error=true
else
error=false
havecase=true
case+="$c "
fi
break
fi
done
done
fi
if $error; then
echo "Incorrect arguments..."
exit 1
fi
if [ -z "$suite" ]; then
suite=$Slist
fi
if [ -z "$precision" ]; then
precision="d"
fi
if [ -z "$case" ]; then
case="large"
fi
# ensure this script is in the cwd
cd "$(dirname "${BASH_SOURCE[0]}")"
# setup output directory
output_dir=rocsolver_customer01_benchmarks
mkdir -p "$output_dir"
# run benchmarks
for s in $suite; do
for p in $precision; do
for c in $case; do
python3 rocsolver-perfoptim-suite.py -v -o "$output_dir/$p${s}_benchmarks.csv" $s $p $c
done
done
done
|