-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (34 loc) · 1.08 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
#TEST_OPTIONS=-DNO_LAMBDA -DDO_LOCALCOPY
TEST_OPTIONS=-DNO_LAMBDA
KOKKOS_DEVICES=SyCL
KOKKOS_CUDA_OPTIONS=enable_lambda
KOKKOS_ARCH = "None"
MAKEFILE_PATH := $(subst Makefile,,$(abspath $(lastword $(MAKEFILE_LIST))))
KOKKOS_PATH=./external/kokkos
ifndef KOKKOS_PATH
KOKKOS_PATH = $(MAKEFILE_PATH)../..
endif
KOKKOS_OPTIONS=disable_deprecated_code,disable_profiling
SRC = $(wildcard $(MAKEFILE_PATH)*.cpp)
HEADERS = $(wildcard $(MAKEFILE_PATH)*.hpp)
vpath %.cpp $(sort $(dir $(SRC)))
default: build
echo "Start Build"
EXE = bytes_and_flops.host
CXX=clang++
CXXFLAGS ?= -O0 -g
override CXXFLAGS += -I$(MAKEFILE_PATH) $(TEST_OPTIONS)
DEPFLAGS = -M
LINK = ${CXX}
LINKFLAGS =
OBJ = $(notdir $(SRC:.cpp=.o))
LIB =
include $(KOKKOS_PATH)/Makefile.kokkos
build: $(EXE)
$(EXE): $(OBJ) $(KOKKOS_LINK_DEPENDS)
$(LINK) $(KOKKOS_LDFLAGS) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(KOKKOS_LIBS) $(LIB) -o $(EXE)
clean: kokkos-clean
rm -f *.o *.cuda *.host
# Compilation rules
%.o:%.cpp $(KOKKOS_CPP_DEPENDS) $(HEADERS)
$(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) $(EXTRA_INC) -c $< -o $(notdir $@)