summaryrefslogtreecommitdiff
path: root/MLP/baselines/cpu/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'MLP/baselines/cpu/Makefile')
-rw-r--r--MLP/baselines/cpu/Makefile23
1 files changed, 22 insertions, 1 deletions
diff --git a/MLP/baselines/cpu/Makefile b/MLP/baselines/cpu/Makefile
index 3404638..7eb5f00 100644
--- a/MLP/baselines/cpu/Makefile
+++ b/MLP/baselines/cpu/Makefile
@@ -1,7 +1,28 @@
+benchmark ?= 1
+debug ?= 0
+native ?= 1
+nop_sync ?= 0
+numa ?= 0
+
+CFLAGS =
+LDFLAGS =
+
+ifeq (${debug}, 1)
+ CFLAGS += -g
+endif
+
+ifeq (${native}, 1)
+ CFLAGS += -march=native
+endif
+
+ifeq (${numa}, 1)
+ LDFLAGS += -lnuma
+endif
+
all: mlp_openmp
mlp_openmp: mlp_openmp.c
- gcc -Wall -Wextra -pedantic -march=native -O2 mlp_openmp.c -o mlp_openmp -fopenmp -std=c99
+ gcc -Wall -Wextra -pedantic -O3 ${CFLAGS} mlp_openmp.c -o mlp_openmp -DNUMA=${numa} -DNOP_SYNC=${nop_sync} -DWITH_BENCHMARK=${benchmark} -fopenmp -std=c99 ${LDFLAGS}
mlp_openmp_O0: mlp_openmp.c
gcc mlp_openmp.c -o mlp_openmp_O0 -fopenmp -std=c99