2022-11-11 12:23:45 +00:00
|
|
|
-include ../../../utilities/options.mk
|
|
|
|
-include ../../../utilities/c2.mk
|
|
|
|
|
2022-11-28 13:37:37 +00:00
|
|
|
|
|
|
|
# Disable make output
|
|
|
|
MAKEFLAGS+= --silent
|
|
|
|
|
2022-11-16 16:04:50 +00:00
|
|
|
# -DPOLYBENCH_TIME makes Polybench output the execution time of the program
|
2022-11-28 13:37:37 +00:00
|
|
|
CXXFLAGS+= -DPOLYBENCH_TIME
|
2022-11-16 00:43:59 +00:00
|
|
|
# -Wall and -Wextra enable more warnings
|
2022-11-28 13:37:37 +00:00
|
|
|
CXXFLAGS+= -Wall
|
|
|
|
CXXFLAGS+= -Wextra
|
2022-11-16 00:43:59 +00:00
|
|
|
# -O3 applies all compiler optimization, improving from 800ms to 300ms
|
2022-11-28 13:37:37 +00:00
|
|
|
CXXFLAGS+= -O3
|
2022-11-17 01:59:31 +00:00
|
|
|
# Extend CFLAGS with command line parameters
|
2022-11-28 13:37:37 +00:00
|
|
|
CXXFLAGS+= ${EXTRA_CXXFLAGS}
|
|
|
|
|
|
|
|
# Select the location of the local CUDA install
|
|
|
|
CUDA_HOME:=/opt/cuda
|
|
|
|
# Specify the directory of the nvc compiler
|
|
|
|
NVCC=$(CUDA_HOME)/bin/nvcc
|
|
|
|
# Specify the flags for the nvc compiler
|
|
|
|
NVCFLAGS:=$(CXXFLAGS) $(NVOPT)
|
2022-11-16 16:06:16 +00:00
|
|
|
|
2022-11-16 16:09:27 +00:00
|
|
|
|
2022-11-28 13:37:37 +00:00
|
|
|
# Create an automake definition for .cu files
|
|
|
|
$(BUILD_DIR)/%.cu.o: %.cu
|
2022-11-28 13:41:35 +00:00
|
|
|
$(MKDIR_P) $(dir $@)
|
|
|
|
$(NVCC) $(NVCFLAGS) -c $< -o $@
|
2022-11-17 01:59:31 +00:00
|
|
|
|
2022-11-16 16:09:27 +00:00
|
|
|
.PHONY: bench
|
|
|
|
|
|
|
|
bench:
|
2022-11-16 16:39:09 +00:00
|
|
|
./.bench.sh
|