-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
106 lines (73 loc) · 2.11 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# ---
# Platform-dependent configuration
#
# If you have multiple platform-dependent configuration options that you want
# to play with, you can put them in an appropriately-named Makefile.in.
# For example, the default setup has a Makefile.in.icc and Makefile.in.gcc.
PLATFORM=gcc
include Makefile.in.$(PLATFORM)
DRIVERS=$(addprefix matmul-,$(BUILDS))
TIMINGS=$(addsuffix .csv,$(addprefix timing-,$(BUILDS)))
.PHONY: all
all: $(DRIVERS)
# ---
# Rules to build the drivers
matmul-%: $(OBJS) dgemm_%.o
$(LD) -o $@ $^ $(LDFLAGS) $(LIBS)
matmul-f2c: $(OBJS) dgemm_f2c.o dgemm_f2c_desc.o fdgemm.o
$(LD) -o $@ $^ $(LDFLAGS) $(LIBS)
matmul-blas: $(OBJS) dgemm_blas.o
$(LD) -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBBLAS)
matmul-mkl: $(OBJS) dgemm_mkl.o
$(LD) -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBMKL)
matmul-veclib: $(OBJS) dgemm_veclib.o
$(LD) -o $@ $^ $(LDFLAGS) $(LIBS) -framework Accelerate
# --
# Rules to build object files
matmul.o: matmul.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $<
%.o: %.c
$(CC) -c $(CFLAGS) $(OPTFLAGS) $(CPPFLAGS) $<
%.o: %.f
$(FC) -c $(FFLAGS) $(OPTFLAGS) $<
dgemm_blas.o: dgemm_blas.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCBLAS) $<
dgemm_mkl.o: dgemm_blas.c
$(CC) -o $@ -c $(CFLAGS) $(CPPFLAGS) $(INCMKL) $<
dgemm_veclib.o: dgemm_blas.c
clang -o $@ -c $(CFLAGS) $(CPPFLAGS) -DOSX_ACCELERATE $<
# ---
# Rules for building timing CSV outputs
.PHONY: run
run: $(TIMINGS)
timing-%.csv: matmul-%
OPENMP_NUM_THREADS=1 ./matmul-$*
# ---
# Rules for plotting
.PHONY: plot
plot:
$(PYTHON) plotter.py $(BUILDS)
# ---
.PHONY: clean realclean
clean:
rm -f matmul-* *.o
realclean: clean
rm -f *~ timing-*.csv timing.pdf
# # Makefile for AMX Test Program using Intel icx Compiler
# # Compiler
# CC = icx
# # Compiler flags
# # -O2 for optimization, -Wall for warnings, -march=native to use native CPU features
# CFLAGS = -O2 -Wall -march=native
# # Name of the executable
# TARGET = test_amx
# # Source files
# SRC = test_amx.c
# # Default rule
# all: $(TARGET)
# # Rule to build the program
# $(TARGET): $(SRC)
# $(CC) $(CFLAGS) -o $(TARGET) $(SRC)
# # Clean rule to remove the executable
# clean:
# rm -f $(TARGET)