-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_all.sh
More file actions
executable file
·84 lines (73 loc) · 1.84 KB
/
Copy pathrun_all.sh
File metadata and controls
executable file
·84 lines (73 loc) · 1.84 KB
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
#!/bin/bash
POSITIONAL_ARGS=()
RUN_CPP=1
RUN_CUDA=1
RUN_PYTHON=1
function print_usage() {
echo "Usage: ${0} [-h|--help] [--skip-c++] [--skip-cuda] [--skip-python] NUMBER_OF_ITERATIONS"
}
while [[ $# -gt 0 ]]; do
case $1 in
--skip-c++)
RUN_CPP=0
shift
;;
--skip-cuda)
RUN_CUDA=0
shift
;;
--skip-python)
RUN_PYTHON=0
shift
;;
-h|--help)
print_usage
exit 0
;;
-*|--*)
echo -e "Unknown option $1\n"
print_usage
exit 1
;;
*)
POSITIONAL_ARGS+=("$1")
shift
;;
esac
done
set -- "${POSITIONAL_ARGS[@]}"
ITERATIONS="${POSITIONAL_ARGS[0]:-1000000}"
REPO_DIR=$(dirname -- "${BASH_SOURCE[0]}")
if [[ $RUN_CPP -ne 0 ]]; then
pushd cpp > /dev/null
echo -e "\e[1mCleaning C++ binaries and rebuilding\e[0m"
make clean && make
echo -e "\n\e[1mMeasuring C++ function call runtimes\e[0m"
./time_extern ${ITERATIONS}
./time_inline ${ITERATIONS}
popd > /dev/null
else
echo -e "\n\e[1mSkipping C++ runtimes\e[0m"
fi
if [[ $RUN_PYTHON -ne 0 ]]; then
echo -e "\n\e[1mMeasuring Python function call runtimes\e[0m"
python python/time-sync.py ${ITERATIONS}
python python/time-asyncio.py ${ITERATIONS}
python python/time-uvloop.py ${ITERATIONS}
python python/time-asyncio-future.py ${ITERATIONS}
python python/time-uvloop-future.py ${ITERATIONS}
python python/time-asyncio-task.py ${ITERATIONS}
python python/time-uvloop-task.py ${ITERATIONS}
else
echo -e "\n\e[1mSkipping Python runtimes\e[0m"
fi
if [[ $RUN_CUDA -ne 0 ]]; then
pushd cuda > /dev/null
echo -e "\n\e[1mCleaning CUDA binaries and rebuilding\e[0m"
make clean && make
echo -e "\n\e[1mMeasuring CUDA kernel launch runtimes\e[0m"
./time_kernel_launch ${ITERATIONS}
popd > /dev/null
else
echo -e "\n\e[1mSkipping CUDA kernel launch runtimes\e[0m"
fi