-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
79 lines (57 loc) · 1.63 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
#PLATFORM = intelfpga
PLATFORM = intelgpu
#PLATFORM = nvidia
ifeq ($(PLATFORM),intelfpga)
#CXX=g++
CXX=arm-linux-gnueabihf-g++
CFLAGS = -Wall -O2 -g -Wno-unknown-pragmas -DINTEL
CFLAGS += $(shell aocl compile-config)
CXXFLAGS = $(CFLAGS) -std=c++11
LDFLAGS = $(shell aocl link-config)
endif
ifeq ($(PLATFORM),intelgpu)
CXX=g++
CXXFLAGS = -Wall -O2 -g -std=gnu++0x -DINTEL
LDFLAGS = -lOpenCL
endif
ifeq ($(PLATFORM),nvidia)
CXX=nvcc
CXXFLAGS = -O2 -std=c++11 -DNVIDIA
LDFLAGS = -lOpenCL
endif
ifneq (,$(SDK))
CXXFLAGS += -I$(SDK)/include
ifneq (,$(ICDHACK))
LDFLAGS += -L$(ICDHACK)/.libs
else
LDFLAGS += -L$(SDK)/lib64
endif
endif
CXXFLAGS += -I./
#LDFLAGS = $(shell aocl link-config) -lnalla_pcie_mmd
#LIBC214 = -L/opt/glibc-2.14/lib
#LDFLAGS = $(shell aocl link-config) $(LIBC214)
INSTALL_PATH ?= /usr/local
all: demohost daxpyhost saxpyhost slowpihost copybenchhost
demohost : demohost.cpp clwrap.hpp
$(CXX) -o $@ $< $(CXXFLAGS) $(LDFLAGS)
daxpyhost : axpyhost.cpp clwrap.hpp
$(CXX) -o $@ $< -DENABLE_DP $(CXXFLAGS) $(LDFLAGS)
saxpyhost : axpyhost.cpp clwrap.hpp
$(CXX) -o $@ $< $(CXXFLAGS) $(LDFLAGS)
slowpihost : slowpihost.cpp clwrap.hpp
$(CXX) -o $@ $< $(CXXFLAGS) $(LDFLAGS)
copybenchhost.o : copybenchhost.cpp clwrap.hpp
print_timing.o : print_timing.cpp clwrap.hpp
copybenchhost : copybenchhost.o print_timing.o
$(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS)
demokernel.aocx : demokernel.cl
aoc -march=emulator -DEMULATOR $<
install: clwrap.hpp
mkdir -p $(INSTALL_PATH)/include
install -t $(INSTALL_PATH)/include clwrap.hpp
clean:
rm -f demohost daxpyhost saxpyhost slowpihost *.o
distclean: clean
rm -f *~
rm -rf *.aocx *.aoco