blob: 4c30f658d3a2dee6ff420e193a24a3663f682dcd (
plain)
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
|
benchmark ?= 1
debug ?= 0
native ?= 1
nop_sync ?= 0
numa ?= 0
numa_memcpy ?= 0
CFLAGS =
LDFLAGS =
ifeq (${debug}, 1)
CFLAGS += -g
endif
ifeq (${native}, 1)
CFLAGS += -march=native
endif
ifeq (${numa}, 1)
LDFLAGS += -lnuma
endif
.PHONY: all
all: bs_omp
bs_omp: bs_omp.c
gcc -Wall -Wextra -pedantic -O3 ${CFLAGS} -DNUMA=${numa} -DNUMA_MEMCPY=${numa_memcpy} -DNOP_SYNC=${nop_sync} -DWITH_BENCHMARK=${benchmark} bs_omp.c -o bs_omp -fopenmp ${LDFLAGS}
bs_omp_O0: bs_omp.c
gcc bs_omp.c -o bs_omp_O0 -fopenmp
bs_omp_O2: bs_omp.c
gcc -O2 bs_omp.c -o bs_omp_O2 -fopenmp
# bs_omp performs a single iteration and must be run in a loop for proper benchmarks
.PHONY: run run_O0 run_O2
run: bs_omp
./bs_omp 262144 16777216
run_O0: bs_omp_O0
./bs_omp_O0 262144 16777216
run_O2: bs_omp_O2
./bs_omp_O2 262144 16777216
.PHONY: clean
clean:
rm -f bs_omp bs_omp_O0 bs_omp_O2
|