forked from ROCm/rocGemmDriver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (64 loc) · 2.74 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
BLIS = -fopenmp -lblis -L extern/blis/lib/ -rpath extern/blis/lib/
FLAME = -lflame -L extern/flame/lib/ -rpath extern/flame/lib/
BOOST = -lboost_program_options
CFLAGS=-DROCM_USE_FLOAT16=1
ifeq ($(ROCBLASPATH),)
ROCBLASLIB = -lrocblas -L /opt/rocm/rocblas/lib/
ROCBLASINCL = -I /opt/rocm/rocblas/include/
else
ifeq ($(DEBUG),1)
ROCBLASLIB = -lrocblas -L $(ROCBLASPATH)/build/debug/library/src/ -rpath $(ROCBLASPATH)/build/debug/library/src/
ROCBLASINCL = -I $(ROCBLASPATH)/library/include/ -I $(ROCBLASPATH)/build/debug/include/ -I $(ROCBLASPATH)/build/debug/include/internal
else
ROCBLASLIB = -lrocblas -L $(ROCBLASPATH)/build/release/library/src/ -rpath $(ROCBLASPATH)/build/release/library/src/
ROCBLASINCL = -I $(ROCBLASPATH)/library/include/ -I $(ROCBLASPATH)/build/release/include/ -I $(ROCBLASPATH)/build/release/include/internal
endif
endif
ifeq ($(CLANG),1)
LINKER_FLAG = -rtlib=compiler-rt
endif
ifeq ($(VALIDATE),1)
ifeq ($(DEBUG),1)
GemmDriver: GemmDriver.o blis_interface.o
/opt/rocm/hip/bin/hipcc -g -o GemmDriver GemmDriver.o blis_interface.o $(LINKER_FLAG) $(BLIS) $(FLAME) $(ROCBLASLIB) $(BOOST)
else
GemmDriver: GemmDriver.o blis_interface.o
/opt/rocm/hip/bin/hipcc -o GemmDriver GemmDriver.o blis_interface.o $(LINKER_FLAG) $(BLIS) $(FLAME) $(ROCBLASLIB) $(BOOST)
endif
else
ifeq ($(DEBUG),1)
GemmDriver: GemmDriver.o
/opt/rocm/hip/bin/hipcc -g -o GemmDriver GemmDriver.o $(LINKER_FLAG) $(ROCBLASLIB) $(BOOST)
else
GemmDriver: GemmDriver.o
/opt/rocm/hip/bin/hipcc -o GemmDriver GemmDriver.o $(LINKER_FLAG) $(ROCBLASLIB) $(BOOST)
endif
endif
ifeq ($(VALIDATE),1)
ifeq ($(DEBUG),1)
GemmDriver.o: GemmDriver.cpp utility.hpp validate.hpp flame_interface.hpp
/opt/rocm/hip/bin/hipcc -g -c GemmDriver.cpp -std=c++14 $(CFLAGS) $(ROCBLASINCL) -I extern/flame/include/ -DVALIDATE
else
GemmDriver.o: GemmDriver.cpp utility.hpp validate.hpp flame_interface.hpp
/opt/rocm/hip/bin/hipcc -c GemmDriver.cpp -std=c++14 $(CFLAGS) $(ROCBLASINCL) -I extern/flame/include/ -DVALIDATE
endif
else
ifeq ($(DEBUG),1)
GemmDriver.o: GemmDriver.cpp utility.hpp
/opt/rocm/hip/bin/hipcc -g -c GemmDriver.cpp -std=c++14 $(CFLAGS) $(ROCBLASINCL)
else
GemmDriver.o: GemmDriver.cpp utility.hpp
/opt/rocm/hip/bin/hipcc -c GemmDriver.cpp -std=c++14 $(CFLAGS) $(ROCBLASINCL)
endif
endif
ifeq ($(VALIDATE),1)
ifeq ($(DEBUG),1)
blis_interface.o: blis_interface.cpp blis_interface.hpp utility.hpp
/opt/rocm/hip/bin/hipcc -g -c blis_interface.cpp -std=c++14 -I extern/blis/include/blis/ $(CFLAGS) $(ROCBLASINCL)
else
blis_interface.o: blis_interface.cpp blis_interface.hpp utility.hpp
/opt/rocm/hip/bin/hipcc -c blis_interface.cpp -std=c++14 -I extern/blis/include/blis/ $(CFLAGS) $(ROCBLASINCL)
endif
endif
clean:
rm -f GemmDriver *.o