-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
128 lines (119 loc) · 6.55 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
UNAME_S = $(shell uname -s)
EXT = so
MAKEFILE=Makefile.qemu
PYTHON?=python3
ifeq ($(UNAME_S),Darwin)
MAKEFILE=Makefile
EXT = dylib
endif
armec.%: $(LIB_HALIDE) $(HYDRIDE_SEMA) $(LEGALIZER)
# - rm $(HYDRIDE_ROOT)/benchmarks/arm/halide/halide_expr_$**.rkt
arme.%: $(LIB_HALIDE) $(HYDRIDE_SEMA) $(LEGALIZER) armec.%
make -C $(HYDRIDE_ROOT)/benchmarks/arm/halide $* -f $(MAKEFILE)
arme1.%: $(LIB_HALIDE) $(HYDRIDE_SEMA) $(LEGALIZER) armec.%
EXPR_DEPTH=1 make -C $(HYDRIDE_ROOT)/benchmarks/arm/halide $* -f $(MAKEFILE)
arme2.%: $(LIB_HALIDE) $(HYDRIDE_SEMA) $(LEGALIZER) armec.%
EXPR_DEPTH=2 make -C $(HYDRIDE_ROOT)/benchmarks/arm/halide $* -f $(MAKEFILE)
arme3.%: $(LIB_HALIDE) $(HYDRIDE_SEMA) $(LEGALIZER) armec.%
EXPR_DEPTH=3 make -C $(HYDRIDE_ROOT)/benchmarks/arm/halide $* -f $(MAKEFILE)
arme4.%: $(LIB_HALIDE) $(HYDRIDE_SEMA) $(LEGALIZER) armec.%
EXPR_DEPTH=4 make -C $(HYDRIDE_ROOT)/benchmarks/arm/halide $* -f $(MAKEFILE)
arme5.%: $(LIB_HALIDE) $(HYDRIDE_SEMA) $(LEGALIZER) armec.%
EXPR_DEPTH=5 make -C $(HYDRIDE_ROOT)/benchmarks/arm/halide $* -f $(MAKEFILE)
arme9.%: $(LIB_HALIDE) $(HYDRIDE_SEMA) $(LEGALIZER) armec.%
EXPR_DEPTH=9 make -C $(HYDRIDE_ROOT)/benchmarks/arm/halide $* -f $(MAKEFILE)
armd.%: $(LIB_HALIDE) $(HYDRIDE_SEMA) $(LEGALIZER)
ENABLE_HYDRIDE=0 make -C $(HYDRIDE_ROOT)/benchmarks/arm/halide $* -f $(MAKEFILE)
armr.%:
@echo "=================================================="
(cd $(HYDRIDE_ROOT)/benchmarks/arm/halide && $*/bin/$*_run.out 3840 2160 ../test_vectors/football3840x2160.bin $*/out/out.bin)
(cd $(HYDRIDE_ROOT)/benchmarks/arm/halide && $*/bin/$*_run.out 3840 2160 ../test_vectors/football3840x2160.bin $*/out/out.bin)
(cd $(HYDRIDE_ROOT)/benchmarks/arm/halide && $*/bin/$*_run.out 3840 2160 ../test_vectors/football3840x2160.bin $*/out/out.bin)
(cd $(HYDRIDE_ROOT)/benchmarks/arm/halide && $*/bin/$*_run.out 3840 2160 ../test_vectors/football3840x2160.bin $*/out/out.bin)
armrd.%:
@echo "=================================================="
(cd $(HYDRIDE_ROOT)/benchmarks/arm/halide && $*/bin_ref/$*_run.out 3840 2160 ../test_vectors/football3840x2160.bin $*/out/out.bin)
(cd $(HYDRIDE_ROOT)/benchmarks/arm/halide && $*/bin_ref/$*_run.out 3840 2160 ../test_vectors/football3840x2160.bin $*/out/out.bin)
(cd $(HYDRIDE_ROOT)/benchmarks/arm/halide && $*/bin_ref/$*_run.out 3840 2160 ../test_vectors/football3840x2160.bin $*/out/out.bin)
(cd $(HYDRIDE_ROOT)/benchmarks/arm/halide && $*/bin_ref/$*_run.out 3840 2160 ../test_vectors/football3840x2160.bin $*/out/out.bin)
LIB_HALIDE=$(HALIDE_SRC)/distrib/lib/libHalide.$(EXT)
$(LIB_HALIDE):
make -C $(HALIDE_SRC) distrib/lib/libHalide.$(EXT) -j8
x86median: $(LIB_HALIDE)
make -C $(HYDRIDE_ROOT)/benchmarks/x86-deprecated/halide median3x3
x86mul: $(LIB_HALIDE)
make -C $(HYDRIDE_ROOT)/benchmarks/x86/halide mul
ALL_ARM_SEMA=$(HYDRIDE_ROOT)/codegen-generator/targets/arm/AllSema.pickle
LEGALIZER=$(HYDRIDE_ROOT)/codegen-generator/tools/low-level-codegen/build/libARMLegalizer.so
LEGALIZER_CPP=$(HYDRIDE_ROOT)/codegen-generator/tools/low-level-codegen/InstSelectors/arm/ARMLegalizer.cpp
SIMILARITY_SUMMARY_SEMA=$(SIMILARITY_ENV)/semantics.py
HYDRIDE_SEMA=$(HYDRIDE_ROOT)/code-synthesizer/hydride/ir/arm/semantics.rkt
$(SIMILARITY_SUMMARY_SEMA): $(ALL_ARM_SEMA)
cp $(HYDRIDE_ROOT)/code-synthesizer/hydride/utils/bvops.rkt $(SIMILARITY_ENV)/RosetteOpsImpl.rkt
(cd $(SIMILARITY_ENV) && $(PYTHON) -m RoseSimilarityChecker)
cp --backup=numbered $(SIMILARITY_SUMMARY_SEMA) $(SIMILARITY_SUMMARY)
cp $(SIMILARITY_SUMMARY_SEMA) $(HYDRIDE_ROOT)/code-synthesizer/dsl-ir/ARMSemantics.py
cp $(SIMILARITY_SUMMARY_SEMA) $(HYDRIDE_ROOT)/codegen-generator/tools/low-level-codegen/InstSelectors/arm/ARMSemantics.py
$(HYDRIDE_SEMA): $(HYDRIDE_ROOT)/code-synthesizer/dsl-ir/ARMSemantics.py
(cd $(HYDRIDE_ROOT)/code-synthesizer/hydride/ir/arm && $(PYTHON) -m EmitHydridePkgDefs)
raco pkg update $(HYDRIDE_ROOT)/code-synthesizer/hydride/
$(LEGALIZER_CPP): $(HYDRIDE_ROOT)/codegen-generator/tools/low-level-codegen/InstSelectors/arm/ARMSemantics.py
(cd $(HYDRIDE_ROOT)/codegen-generator/tools/low-level-codegen/InstSelectors/arm/ && $(PYTHON) RoseARMLegalizerGen.py)
$(LEGALIZER): $(LEGALIZER_CPP)
make -C $(HYDRIDE_ROOT)/codegen-generator/tools/low-level-codegen/build
$(ALL_ARM_SEMA):
make -C $(HYDRIDE_ROOT)/codegen-generator/targets/arm AllSema.pickle
halide: $(LIB_HALIDE)
make -C $(HALIDE_SRC) distrib/lib/libHalide.$(EXT) -j8
mlir:
make -C /home/muchenx2/llvm-15/build -j32
similaritytest:
cp $(HYDRIDE_ROOT)/code-synthesizer/hydride/utils/bvops.rkt $(SIMILARITY_ENV)/RosetteOpsImpl.rkt
(cd $(SIMILARITY_ENV) && $(PYTHON) -m RoseSimilarityChecker)
similarity:
cp $(HYDRIDE_ROOT)/code-synthesizer/hydride/utils/bvops.rkt $(SIMILARITY_ENV)/RosetteOpsImpl.rkt
(cd $(SIMILARITY_ENV) && $(PYTHON) -m RoseSimilarityChecker)
cp --backup=numbered $(SIMILARITY_SUMMARY_SEMA) $(SIMILARITY_SUMMARY)
cp $(SIMILARITY_SUMMARY_SEMA) $(HYDRIDE_ROOT)/code-synthesizer/dsl-ir/ARMSemantics.py
cp $(SIMILARITY_SUMMARY_SEMA) $(HYDRIDE_ROOT)/codegen-generator/tools/low-level-codegen/InstSelectors/arm/ARMSemantics.py
hydride_pkg = $(HYDRIDE_ROOT)/code-synthesizer/hydride/ir/arm/get_ops.rkt #
$(hydride_pkg): $(HYDRIDE_ROOT)/code-synthesizer/dsl-ir/VISASemantics.py
(cd $(HYDRIDE_ROOT)/code-synthesizer/hydride/ir/visa && $(PYTHON) -m EmitHydridePkgDefs)
hydride_sema:
$(MAKE) $(hydride_pkg)
raco pkg update $(HYDRIDE_ROOT)/code-synthesizer/hydride/
legalizer:
rm $(HYDRIDE_ROOT)/codegen-generator/tools/low-level-codegen/InstSelectors/arm/*.cpp
(cd $(HYDRIDE_ROOT)/codegen-generator/tools/low-level-codegen/InstSelectors/arm/ && $(PYTHON) RoseARMLegalizerGen.py)
(cd $(HYDRIDE_ROOT)/codegen-generator/tools/low-level-codegen/build && cmake ..)
make -C $(HYDRIDE_ROOT)/codegen-generator/tools/low-level-codegen/build -j64
arm_sema:
make -C $(HYDRIDE_ROOT)/codegen-generator/targets/arm AllSema.pickle
syncsema:
cp $(SIMILARITY_SUMMARY)/semantics.py $(HYDRIDE_ROOT)/code-synthesizer/dsl-ir/ARMSemantics.py
cp $(SIMILARITY_SUMMARY)/semantics.py $(HYDRIDE_ROOT)/codegen-generator/tools/low-level-codegen/InstSelectors/arm/ARMSemantics.py
.PHONY: similarity hydride_sema arm_sema halide legalizer
compileall: arme1.add \
arme1.average_pool \
arme.blur3x3 \
arme.dilate3x3 \
arme.dilate5x5 \
arme1.gaussian3x3 \
arme1.gaussian5x5 \
arme1.l2norm \
arme.matmul_256_32bit \
arme.max_pool \
arme.median3x3 \
arme1.sobel3x3
disableall: armd.add \
armd.average_pool \
armd.blur3x3 \
armd.dilate3x3 \
armd.dilate5x5 \
armd.gaussian3x3 \
armd.gaussian5x5 \
armd.l2norm \
armd.matmul_256_32bit \
armd.max_pool \
armd.median3x3 \
armd.sobel3x3