Source

benchmark_rnn / Makefile

Full commit
ALL = \
	rnn_ca1d-gcc-O2 rnn_ca1d-gcc-O3 rnn_ca1d-icc-O2 rnn_ca1d-icc-O3 \
	rnn_ca2d-gcc-O2 rnn_ca2d-gcc-O3 rnn_ca2d-icc-O2 rnn_ca2d-icc-O3 \
	rnn_opt0-gcc-O2 rnn_opt0-gcc-O3 rnn_opt0-icc-O2 rnn_opt0-icc-O3 \
	rnn_opt1-gcc-O2 rnn_opt1-gcc-O3 rnn_opt1-icc-O2 rnn_opt1-icc-O3 \
	rnn_opt2-gcc-O2 rnn_opt2-gcc-O3 rnn_opt2-icc-O2 rnn_opt2-icc-O3 \
	rnn_opt3-gcc-O2 rnn_opt3-gcc-O3 rnn_opt3-icc-O2 rnn_opt3-icc-O3 \
	rnn_opt4-gcc-O2 rnn_opt4-gcc-O3 rnn_opt4-icc-O2 rnn_opt4-icc-O3 \

#ALL = \
	rnn_ca1d-gcc-O2 rnn_ca1d-gcc-O3 \
	rnn_ca2d-gcc-O2 rnn_ca2d-gcc-O3 \

.PHONY: clean all runtest

all: ${ALL}

clean:
	rm ${ALL}

rnn_ca1d-gcc-O2: rnn_ca1d.c
	gcc -lm -O2 $< -o $@
rnn_ca1d-gcc-O3: rnn_ca1d.c
	gcc -lm -O3 $< -o $@ -ftree-vectorizer-verbose=1
rnn_ca1d-icc-O2: rnn_ca1d.c
	icc -vec-report1 -O2 $< -o $@
rnn_ca1d-icc-O3: rnn_ca1d.c
	icc -vec-report1 -O3 $< -o $@

rnn_ca2d-gcc-O2: rnn_ca2d.c
	gcc -lm -O2 $< -o $@
rnn_ca2d-gcc-O3: rnn_ca2d.c
	gcc -lm -O3 $< -o $@ -ftree-vectorizer-verbose=1
rnn_ca2d-icc-O2: rnn_ca2d.c
	icc -vec-report1 -O2 $< -o $@
rnn_ca2d-icc-O3: rnn_ca2d.c
	icc -vec-report1 -O3 $< -o $@

rnn_opt0-gcc-O2: rnn_opt0.c
	gcc -lm -O2 $< -o $@
rnn_opt0-gcc-O3: rnn_opt0.c
	gcc -lm -O3 $< -o $@ -ftree-vectorizer-verbose=1
rnn_opt0-icc-O2: rnn_opt0.c
	icc -vec-report1 -O2 $< -o $@
rnn_opt0-icc-O3: rnn_opt0.c
	icc -vec-report1 -O3 $< -o $@

rnn_opt1-gcc-O2: rnn_opt1.c
	gcc -lm -O2 $< -o $@
rnn_opt1-gcc-O3: rnn_opt1.c
	gcc -lm -O3 $< -o $@ -ftree-vectorizer-verbose=1
rnn_opt1-icc-O2: rnn_opt1.c
	icc -vec-report1 -O2 $< -o $@
rnn_opt1-icc-O3: rnn_opt1.c
	icc -vec-report1 -O3 $< -o $@

rnn_opt2-gcc-O2: rnn_opt2.c
	gcc -lm -O2 $< -o $@
rnn_opt2-gcc-O3: rnn_opt2.c
	gcc -lm -O3 $< -o $@ -ftree-vectorizer-verbose=1
rnn_opt2-icc-O2: rnn_opt2.c
	icc -vec-report1 -O2 $< -o $@
rnn_opt2-icc-O3: rnn_opt2.c
	icc -vec-report1 -O3 $< -o $@

rnn_opt3-gcc-O2: rnn_opt3.c
	gcc -lm -O2 -std=c99 $< -o $@
rnn_opt3-gcc-O3: rnn_opt3.c
	gcc -lm -O3 -std=c99 $< -o $@ -ftree-vectorizer-verbose=1
rnn_opt3-icc-O2: rnn_opt3.c
	icc -vec-report1 -O2 -restrict $< -o $@
rnn_opt3-icc-O3: rnn_opt3.c
	icc -vec-report1 -O3 -restrict $< -o $@

rnn_opt4-gcc-O2: rnn_opt4.c
	gcc -lm -O2 -std=c99 $< -o $@
rnn_opt4-gcc-O3: rnn_opt4.c
	gcc -lm -O3 -std=c99 $< -o $@ -ftree-vectorizer-verbose=1
rnn_opt4-icc-O2: rnn_opt4.c
	icc -vec-report1 -O2 -restrict $< -o $@
rnn_opt4-icc-O3: rnn_opt4.c
	icc -vec-report1 -O3 -restrict $< -o $@

num_c=30
num_s=1000
repeat_times=300
#repeat_times=1

# print command and time output to standard error
runtest: ${ALL}
	for i in  $^; \
	do \
	printf "%s %d %d %d " \
	./$$i ${num_c} ${num_s} ${repeat_times} 1>&2; \
	time ./$$i ${num_c} ${num_s} ${repeat_times}; \
	done