Skip to content

Instantly share code, notes, and snippets.

@FindHao
Last active April 23, 2021 04:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FindHao/6c94a755ab6304a985fd86992317d77a to your computer and use it in GitHub Desktop.
Save FindHao/6c94a755ab6304a985fd86992317d77a to your computer and use it in GitHub Desktop.
nsys script
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Wrong arguments"
exit
fi
working_dir=$1
first_arg=$2
# if [[ $first_arg != \./* ]];
# then
# working_dir=$(dirname $first_arg)
# fi
execute_name=$(basename $first_arg)
cd $working_dir
mkdir reports
cd reports
rm report*.qdrep
rm report*.sqlite
rm report*.csv
cd ..
for i in {1..10}; do
nsys profile -o reports/report${i}_$execute_name -t cuda "${@:2}"
cd reports
nsys stats -f csv -o report${i}_$execute_name ./report${i}_$execute_name.qdrep
nsys stats -f csv --report gpumemtimesum -o report${i}_$execute_name ./report${i}_$execute_name.qdrep
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment