-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
88 lines (65 loc) · 3.88 KB
/
Makefile
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
#### ICL-NUIM TRAJECTORIES PARAMETERS ####
0 = -s 5.0 -p 0.34,0.5,0.24 -z 4 -c 2 -r 2 -k 481.2,480,320,240
1 = -s 5.0 -p 0.485,0.5,0.55 -z 4 -c 2 -r 2 -k 481.2,480,320,240
2 = -s 4.8 -p 0.34,0.5,0.24 -z 4 -c 2 -r 2 -k 481.2,480,320,240
3 = -s 5.0 -p 0.2685,0.5,0.4 -z 4 -c 2 -r 2 -k 481.2,480,320,240
ROOT_DIR=$(shell pwd)
TOON_DIR=${ROOT_DIR}/TooN/install_dir
TOON_INCLUDE_DIR=${TOON_DIR}/include/
all : build
build : TooN
mkdir -p build/
cd build/ && cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DTOON_INCLUDE_PATH=${TOON_INCLUDE_DIR} $(CMAKE_ARGUMENTS)
$(MAKE) -C build $(MFLAGS) $(SPECIFIC_TARGET)
#### Dependencies ####
TooN:
git clone https://github.com/edrosten/TooN.git
cd TooN && git checkout 92241416d2a4874fd2334e08a5d417dfea6a1a3f
mkdir -p ${TOON_DIR}
cd TooN && ./configure --prefix=${TOON_DIR} --disable-lapack && make install
#### DATA SET GENERATION ####
./build/kfusion/thirdparty/scene2raw : TooN
mkdir -p build/
cd build/ && cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DTOON_INCLUDE_PATH=${TOON_INCLUDE_DIR} $(CMAKE_ARGUMENTS)
$(MAKE) -C build $(MFLAGS) scene2raw
living_room_traj%_loop.raw : living_room_traj%_loop ./build/kfusion/thirdparty/scene2raw
if test -x ./build/kfusion/thirdparty/scene2raw ; then echo "..." ; else echo "do make before"; false ; fi
if test -x living_room_traj$(*F)_loop.raw; then echo "raw input file already present, no need for conversion. " ; else ./build/kfusion/thirdparty/scene2raw living_room_traj$(*F)_loop living_room_traj$(*F)_loop.raw; fi
living_room_traj%_loop :
mkdir $@
cd $@ ; wget http://www.doc.ic.ac.uk/~ahanda/[email protected]; tar xzf [email protected]
livingRoom%.gt.freiburg :
echo "Download ground truth trajectory..."
if test -x $@ ; then echo "Done" ; else wget http://www.doc.ic.ac.uk/~ahanda/VaFRIC/$@ ; fi
#### LOG GENERATION ####
%.opencl.log : living_room_traj%_loop.raw livingRoom%.gt.freiburg
$(MAKE) -C build $(MFLAGS) kfusion-benchmark-opencl oclwrapper
LD_PRELOAD=./build/kfusion/thirdparty/liboclwrapper.so ./build/kfusion/kfusion-benchmark-opencl $($(*F)) -i living_room_traj$(*F)_loop.raw -o benchmark.$@ 2> oclwrapper.$@
cat oclwrapper.$@ |grep -E ".+ [0-9]+ [0-9]+ [0-9]+" |cut -d" " -f1,4 > kernels.$@
./kfusion/thirdparty/checkPos.py benchmark.$@ livingRoom$(*F).gt.freiburg > resume.$@
./kfusion/thirdparty/checkKernels.py kernels.$@ >> resume.$@
%.cpp.log : living_room_traj%_loop.raw livingRoom%.gt.freiburg
$(MAKE) -C build $(MFLAGS) kfusion-benchmark-cpp
KERNEL_TIMINGS=1 ./build/kfusion/kfusion-benchmark-cpp $($(*F)) -i living_room_traj$(*F)_loop.raw -o benchmark.$@ 2> kernels.$@
./kfusion/thirdparty/checkPos.py benchmark.$@ livingRoom$(*F).gt.freiburg > resume.$@
./kfusion/thirdparty/checkKernels.py kernels.$@ >> resume.$@
%.openmp.log : living_room_traj%_loop.raw livingRoom%.gt.freiburg
$(MAKE) -C build $(MFLAGS) kfusion-benchmark-openmp
KERNEL_TIMINGS=1 ./build/kfusion/kfusion-benchmark-openmp $($(*F)) -i living_room_traj$(*F)_loop.raw -o benchmark.$@ 2> kernels.$@
./kfusion/thirdparty/checkPos.py benchmark.$@ livingRoom$(*F).gt.freiburg > resume.$@
./kfusion/thirdparty/checkKernels.py kernels.$@ >> resume.$@
%.cuda.log : living_room_traj%_loop.raw livingRoom%.gt.freiburg
$(MAKE) -C build $(MFLAGS) kfusion-benchmark-cuda
nvprof --print-gpu-trace ./build/kfusion/kfusion-benchmark-cuda $($(*F)) -i living_room_traj$(*F)_loop.raw -o benchmark.$@ 2> nvprof.$@ || true
cat nvprof.$@ | kfusion/thirdparty/nvprof2log.py > kernels.$@
./kfusion/thirdparty/checkPos.py benchmark.$@ livingRoom$(*F).gt.freiburg > resume.$@
./kfusion/thirdparty/checkKernels.py kernels.$@ >> resume.$@
#### GENERAL GENERATION ####
clean :
rm -rf build TooN
cleanall :
rm -rf build TooN
rm -rf living_room_traj*_loop livingRoom*.gt.freiburg living_room_traj*_loop.raw
rm -f *.log
.PHONY : clean bench test all validate build
.PRECIOUS: living_room_traj%_loop livingRoom%.gt.freiburg living_room_traj%_loop.raw