Skip to content
Snippets Groups Projects

1st upload

Closed Masudur Rahaman Kazi requested to merge mrk_br0 into main
Files
23
+ 63
0
# configuration
TEST_CASE = stream
BUILD_DIR = ../../build/$(TEST_CASE)
# default benchmark parameters
NX = 67108864
NWARM = 2
NIT = 10
PARAMETERS = ${NX} ${NWARM} ${NIT}
# all
targets = $(BUILD_DIR)/$(TEST_CASE)-base $(BUILD_DIR)/$(TEST_CASE)-omp-host
.PHONY: all
all: mk-target-dir $(targets)
mk-target-dir:
mkdir -p $(BUILD_DIR)
# build rules
$(BUILD_DIR)/$(TEST_CASE)-base: $(TEST_CASE)-base.cpp $(TEST_CASE)-util.h ../util.h
g++ -O3 -march=native -std=c++17 -o $(BUILD_DIR)/$(TEST_CASE)-base $(TEST_CASE)-base.cpp
$(BUILD_DIR)/$(TEST_CASE)-omp-host: $(TEST_CASE)-omp-host.cpp $(TEST_CASE)-util.h ../util.h
g++ -O3 -march=native -std=c++17 -fopenmp -o $(BUILD_DIR)/$(TEST_CASE)-omp-host $(TEST_CASE)-omp-host.cpp
# aliases without build directory
.PHONY: $(TEST_CASE)-base
$(TEST_CASE)-base: $(BUILD_DIR)/$(TEST_CASE)-base
.PHONY: $(TEST_CASE)-omp-host
$(TEST_CASE)-omp-host: $(BUILD_DIR)/$(TEST_CASE)-omp-host
# automated benchmark target
.PHONY: bench
bench: all
@echo "Base:"
$(BUILD_DIR)/$(TEST_CASE)-base $(PARAMETERS)
@echo ""
@echo "OpenMP Host:"
$(BUILD_DIR)/$(TEST_CASE)-omp-host $(PARAMETERS)
@echo ""
# clean target
.PHONY: clean
clean:
rm $(targets)
Loading