-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (56 loc) · 1.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
export SHELL = /bin/bash
export OS = $(shell uname)
export DIR = $(shell pwd)
export MKDIR = mkdir -p
export RM = rm -rf
.PHONY: all
all: build/bin/siphon
build/bin/siphon:
$(RM) build
$(MKDIR) build
. scl_source enable devtoolset-8; \
set -e; \
cd build; \
. /opt/intel/mkl/bin/mklvars.sh intel64; \
time cmake -DCMAKE_VERBOSE_MAKEFILE=ON -GNinja ..; \
time cmake --build .;
.PHONY: run
run: build/bin/siphon
. scl_source enable devtoolset-8; \
set -e; \
cd build; \
. /opt/intel/mkl/bin/mklvars.sh intel64; \
$(RM) models; \
$(MKDIR) models; \
time bin/siphon --caffe2_log_level=0 --load ../test/resnet50 --save models/c2_native --save_onnx models/onnx_from_c2; \
time bin/siphon --caffe2_log_level=0 --load models/onnx_from_c2 --save models/c2_from_onnx --save_onnx models/onnx_from_onnx;
.PHONY: convert
convert: build/bin/siphon
. scl_source enable devtoolset-8; \
set -e; \
cd build; \
. /opt/intel/mkl/bin/mklvars.sh intel64; \
$(RM) models; \
$(MKDIR) models; \
find "../test/contrib/" -mindepth 1 -type d \
| parallel --bar -j0 -k 'bash -c '"'"' \
set -e; \
time if grep "_onnx$$" <<< {} > /dev/null; then \
bin/siphon --caffe2_log_level=0 --load {} --save "models/$$(basename {} | sed "s/_onnx$$//")"; \
else \
bin/siphon --caffe2_log_level=0 --load {} --save "models/$$(basename {} )" --save_onnx "models/$$(basename {})_onnx"; \
fi; \
'"'";
.PHONY: debug
debug: build/bin/siphon
. scl_source enable devtoolset-8; \
set -e; \
cd build; \
. /opt/intel/mkl/bin/mklvars.sh intel64; \
$(RM) models; \
$(MKDIR) models; \
LD_DEBUG=files bin/siphon --caffe2_log_level=0 --load ../test/resnet50 --save models/c2_native --save_onnx models/onnx_from_c2; \
LD_DEBUG= gdb --args bin/siphon --caffe2_log_level=0 --load models/onnx_from_c2 --save models/c2_from_onnx --save_onnx models/onnx_from_onnx;
.PHONY: clean
clean:
$(RM) build