-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.sh
executable file
·60 lines (50 loc) · 1.32 KB
/
profile.sh
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
echo "Running profiling..."
threads=(10 8 4 2 1)
width=1500
height=800
samples=100
echo -e "width: $width \theight: $height \tsamples: $samples \tthreads: ${threads[*]}"
prefix="Render time:"
function cancel {
echo "Received SIGQUIT. Exiting."
exit 0;
}
trap cancel SIGQUIT
for scene in `seq 0 2`
do
echo -n "GPU BVH $scene..."
file="GPU_BVH"$scene".out"
./PathTracer -w $width -h $height -p $scene -d 0 -a 1>$file
timing="$(grep "$prefix" $file)"
echo "$timing" | sed -e "s/^$prefix//"
done
for scene in `seq 0 2`
do
echo -n "GPU scene $scene..."
file="GPU_scene"$scene".out"
./PathTracer -w $width -h $height -s $samples -p $scene -d 0 1>$file
timing="$(grep "$prefix" $file)"
echo "$timing" | sed -e "s/^$prefix//"
done
for scene in `seq 0 2`
do
for i in ${threads[@]}
do
echo -n "CPU BVH $scene threads $i..."
file="CPU_BVH_"$scene"_threads_"$i".out"
./PathTracer -w $width -h $height -p $scene -d 1 -t $i -a 1>$file
timing="$(grep "$prefix" $file)"
echo "$timing" | sed -e "s/^$prefix//"
done
done
for scene in `seq 0 2`
do
for i in ${threads[@]}
do
echo -n "CPU scene $scene threads $i..."
file="CPU_scene_"$scene"_threads_"$i".out"
./PathTracer -w $width -h $height -s $samples -p $scene -d 1 -t $i 1>$file
timing="$(grep "$prefix" $file)"
echo "$timing" | sed -e "s/^$prefix//"
done
done