forked from vlfeat/matconvnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.mex
25 lines (17 loc) · 801 Bytes
/
Makefile.mex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Compile using only MEX. The CUDA version must match MATLAB's.
# Prefer .cu over .cpp and .c when GPU is enabled; this rule must come
# before the following ones.
ifneq ($(ENABLE_GPU),)
matlab/mex/.build/%.o : matlab/src/bits/%.cu matlab/mex/.build/.stamp
MW_NVCC_PATH='$(NVCC)' \
$(MEX) -c $(MEXFLAGS_GPU) "$(<)" $(nvcc_filter)
mv -f "$(notdir $(@))" "$(@)"
matlab/mex/%.mex$(MEXARCH) : matlab/src/%.cu $(cpp_tgt) $(cu_tgt)
MW_NVCC_PATH='$(NVCC)' \
$(MEX) $(MEXFLAGS_GPU) "$(<)" -output "$(@)" $(cpp_tgt) $(cu_tgt) $(nvcc_filter)
endif
matlab/mex/.build/%.o : matlab/src/bits/%.cpp matlab/mex/.build/.stamp
$(MEX) -c $(MEXFLAGS_CPU) "$(<)"
mv -f "$(notdir $(@))" "$(@)"
matlab/mex/%.mex$(MEXARCH) : matlab/src/%.cpp $(cpp_tgt)
$(MEX) $(MEXFLAGS_CPU) "$(<)" -output "$(@)" $(cpp_tgt)