forked from intel/caffe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.dlcp
63 lines (55 loc) · 1.71 KB
/
Makefile.dlcp
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
CAFFE_ROOTDIR := $(shell pwd)
DLCP_IDEEPDIR := $(CAFFE_ROOTDIR)/external/ideep
DLCP_ROOTDIR := $(DLCP_IDEEPDIR)/dlcp
DLCP_INCLDIR := $(DLCP_ROOTDIR)/include
DLCP_LIBDIR := $(DLCP_ROOTDIR)/lib
IDEEP_GITHUB := https://github.com/intel/ideep.git
DLCP_CXX := $(CXX)
ifeq ("$(wildcard $(DLCP_INCLDIR)/dl_compression.h)", "")
dlcp_download:
rm -rf $(DLCP_IDEEPDIR)
git clone $(IDEEP_GITHUB) -b ideep4py $(DLCP_IDEEPDIR)
dlcp_build: dlcp_download
make -C $(DLCP_ROOTDIR) -j$(shell cat /proc/cpuinfo |grep 'processor'|wc -l)
else
dlcp_download:
dlcp_build:
make -C $(DLCP_ROOTDIR) -j$(shell cat /proc/cpuinfo |grep 'processor'|wc -l)
endif
dlcp_clean:
@rm -rf $(DLCP_IDEEPDIR)
dlcproot_set:
$(eval COMMON_FLAGS += -DENABLE_WEIGHT_GRAD_COMPRESSION) \
$(eval INCLUDE_DIRS += $(DLCP_INCLDIR)) \
$(eval DLCP_LDFLAGS += -ldlcomp -L$(DLCPROOT)/lib) \
$(eval DLCP_LDFLAGS += -Wl,-rpath,$(DLCPROOT)/lib)
dlcproot_notset: dlcp_build
$(eval COMMON_FLAGS += -DENABLE_WEIGHT_GRAD_COMPRESSION) \
$(eval INCLUDE_DIRS += $(DLCP_INCLDIR)) \
$(eval DLCP_LDFLAGS += -ldlcomp) \
$(eval DLCP_LDFLAGS += -L$(DLCP_LIBDIR) -Wl,-rpath,${DLCP_LIBDIR})
ifeq (,$(findstring icpc, $(DLCP_CXX)))
ifneq (,$(findstring icpc,$(shell command -v icpc)))
DLCP_CXX := icpc
endif
endif
ifeq ($(USE_MLSL), 1)
ifneq ($(ENABLE_WEIGHT_GRAD_COMPRESSION), 0)
ifeq ($(origin DLCPROOT), environment)
dlcp: dlcproot_set
else
ifneq (,$(findstring icpc,$(DLCP_CXX)))
dlcp: dlcproot_notset
else
dlcp:
@echo "weight grad compression disabled because intel compiler not found"
endif
endif
else
dlcp:
@echo "disabling weight grad compression if ENABLE_WEIGHT_GRAD_COMPRESSION is set to 0"
endif
else
dlcp:
@echo "disabling weight grad compression if USE_MLSL is not 1"
endif