-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile2
65 lines (52 loc) · 1.5 KB
/
Makefile2
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
KOKKOS_PATH = /rr-home/istvan/kokkos
#../../..
KOKKOS_SRC_PATH = ${KOKKOS_PATH}
SRC = multimat.cpp full_matrix.cpp compact_kokkos.cpp #$(wildcard ${KOKKOS_SRC_PATH}/example/tutorial/03_simple_view_lambda/*.cpp)
vpath %.cpp $(sort $(dir $(SRC)))
default: build
echo "Start Build"
ifneq (,$(findstring Cuda,$(KOKKOS_DEVICES)))
CXX = ${KOKKOS_PATH}/bin/nvcc_wrapper
CXXFLAGS = -O3 #--use_fast_math
LINK = ${CXX}
LDFLAGS = -fopenmp
EXE = multimat_kokkos
KOKKOS_DEVICES = "Cuda,OpenMP"
KOKKOS_ARCH = "Pascal60"
KOKKOS_CUDA_OPTIONS += "enable_lambda"
else
#CXX = g++
#CXX = icpc
CXX = clang++
#CXXFLAGS = -Ofast -ffp-contract=fast -fopenmp ${FLAGS}
#CXXFLAGS = -qopt-report=5 -xHost -fp-model fast -qopenmp ${FLAGS}
CXXFLAGS = -Ofast -fopenmp -ffp-contract=fast ${FLAGS}
LINK = ${CXX}
LDFLAGS =
EXE = multimat_kokkos
KOKKOS_DEVICES = "OpenMP"
KOKKOS_ARCH = "BDW"
endif
ifneq (,$(findstring ROCm,$(KOKKOS_DEVICES)))
CXX = /opt/rocm/hcc/bin/clang++
CXXFLAGS = -O3
LINK = ${CXX}
LDFLAGS =
EXE = 03_simple_view_lambda.rocm
KOKKOS_DEVICES = "ROCm"
KOKKOS_ARCH = "Fiji"
endif
DEPFLAGS = -M
OBJ = $(notdir $(SRC:.cpp=.o))
LIB =
include $(KOKKOS_PATH)/Makefile.kokkos
build: $(EXE)
test: $(EXE)
./$(EXE)
$(EXE): $(OBJ) $(KOKKOS_LINK_DEPENDS)
$(LINK) $(KOKKOS_LDFLAGS) $(LDFLAGS) $(EXTRA_PATH) $(OBJ) $(KOKKOS_LIBS) $(LIB) -o $(EXE)
clean: kokkos-clean
rm -f *.o *.cuda *.host *.rocm
# Compilation rules
%.o:%.cpp $(KOKKOS_CPP_DEPENDS)
$(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) $(EXTRA_INC) -c $< -o $(notdir $@)