-
Notifications
You must be signed in to change notification settings - Fork 346
/
Makefile
33 lines (22 loc) · 1.23 KB
/
Makefile
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
NVCC=nvcc
NVCC_FLAGS=-std=c++17 -O3 --generate-code arch=compute_70,code=sm_70 --generate-code arch=compute_75,code=sm_75 --generate-code arch=compute_80,code=sm_80 --generate-code arch=compute_86,code=sm_86
CUFFTDX_INCLUDE_DIR=${mathdx_ROOT}/include/
COMMONDX_INCLUDE_DIR=${mathdx_ROOT}/include/commondx/
CUDA_BIN_DIR=$(shell dirname `which $(NVCC)`)
CUDA_INCLUDE_DIR=$(CUDA_BIN_DIR)/../include
NVCC_DEFINES=-DCUFFTDX_DISABLE_CUTLASS_DEPENDENCY
NVRTC_DEFINES=-DCUDA_INCLUDE_DIR="\"$(CUDA_INCLUDE_DIR)\"" -DCOMMONDX_INCLUDE_DIR="\"$(COMMONDX_INCLUDE_DIR)\"" -DCUFFTDX_INCLUDE_DIRS="\"$(CUFFTDX_INCLUDE_DIR)\""
SRCS=$(filter-out nvrtc_fft_block.cu nvrtc_fft_thread.cu, $(wildcard *.cu))
TARGETS=$(patsubst %.cu,%,$(SRCS))
NVRTC_SRCS=$(wildcard nvrtc_*.cu)
NVRTC_TARGETS=$(patsubst %.cu,%,$(NVRTC_SRCS))
$(TARGETS): %: %.cu
$(NVCC) -o $@ $< $(NVCC_FLAGS) -I$(CUFFTDX_INCLUDE_DIR) -I$(COMMONDX_INCLUDE_DIR) $(NVCC_DEFINES) -lcufft
$(NVRTC_TARGETS): %: %.cu
$(NVCC) -o $@ $< $(NVCC_FLAGS) -I$(CUFFTDX_INCLUDE_DIR) -I$(COMMONDX_INCLUDE_DIR) $(NVRTC_DEFINES) -lnvrtc -lcuda
.PHONY: all clean
all: $(TARGETS) $(NVRTC_TARGETS) $(CUFFT_TARGETS)
$(echo $(NVRTC_TARGETS))
clean:
rm -f $(TARGETS) $(NVRTC_TARGETS) $(CUFFT_TARGETS)
.DEFAULT_GOAL := all