外观
parallel/Makefile
配套源码,运行方法见同目录 README。返回实验总览。
makefile
CXX ?= c++
CXXFLAGS ?= -std=c++17 -O3 -g -Wall -Wextra -Wpedantic -Werror
PROGRAMS = benchmark false_sharing
all: $(PROGRAMS)
%: %.cpp
$(CXX) $(CXXFLAGS) $< -o $@ -pthread
test: all
./benchmark 1003 4 17 3
./benchmark 3 8 1 3
./false_sharing 4 20000 3
benchmark-run: all
./benchmark 200000 4 64 5
./false_sharing 4 1000000 5
sanitize:
$(MAKE) clean
$(MAKE) CXXFLAGS='-std=c++17 -O1 -g -Wall -Wextra -Wpedantic -Werror -fsanitize=address,undefined -fno-omit-frame-pointer' test
gpu:
nvcc -std=c++17 -O2 reduction.cu -o reduction
clean:
rm -f $(PROGRAMS) reduction
rm -rf *.dSYM
.PHONY: all test benchmark-run sanitize gpu clean