forked from drgregory/proj3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (25 loc) · 963 Bytes
/
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
HOME = /home/ff/cs61c
CC = gcc-4.5 -std=gnu99
GOTO = $(HOME)/bin/GotoBLAS2_Linux
GOTOLIB = $(GOTO)/libgoto2_nehalemp-r1.13.a
INCLUDES = -I$(GOTO)
OMP = -fopenmp
LIBS = -lpthread
# a pretty good flag selection for this machine...
CFLAGS = -fopenmp -O2 -pipe -fno-omit-frame-pointer -march=native
all: bench-blas bench-naive bench-small bench-all bench-openmp
# triple nested loop implementation
bench-naive: benchmark.o sgemm-naive.o
$(CC) -o $@ $(LIBS) benchmark.o sgemm-naive.o $(GOTOLIB)
bench-small: benchmark.o sgemm-small.o
$(CC) -o $@ $(LIBS) benchmark.o sgemm-small.o $(GOTOLIB)
hadd: test.o
$(CC) -o $@ $(LIBS) test.o $(GOTOLIB)
bench-all: benchmark.o sgemm-all.o
$(CC) -o $@ $(LIBS) benchmark.o sgemm-all.o $(GOTOLIB)
bench-openmp: benchmark.o sgemm-openmp.o
$(CC) -o $@ $(LIBS) $(OMP) benchmark.o sgemm-openmp.o $(GOTOLIB)
%.o: %.c
$(CC) -c $(CFLAGS) $(INCLUDES) $<
clean:
rm -f *~ bench-all bench-naive bench-small bench-openmp *.o