forked from anilshanbhag/crystal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (30 loc) · 973 Bytes
/
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
34
35
36
37
38
39
40
41
CUDA_PATH ?= /usr/local/cuda
CUDA_INC_PATH ?= $(CUDA_PATH)/include
CUDA_BIN_PATH ?= $(CUDA_PATH)/bin
SM ?= 60
NVCC = nvcc
SM_TARGETS = -gencode=arch=compute_$(SM),code=\"sm_$(SM),compute_$(SM)\"
SM_DEF = -DSM$(SM)0
# non-caching loads (L1 disabled): -Xptxas -dlcm=cg
# caching loads (L1 enabled, default): -Xptxas -dlcm=ca
NVCCFLAGS += --std=c++17 --expt-extended-lambda $(SM_DEF) -Xptxas="-v" -lineinfo -Xcudafe -\#
SRC = src
BIN = bin
OBJ = obj
CUB_DIR = cub/
INCLUDES = -I$(CUB_DIR) -I$(CUB_DIR)test -I. -I$(INC)
$(OBJ)/%.o: $(SRC)/%.cu
$(NVCC) -lcurand $(SM_TARGETS) $(NVCCFLAGS) $(CPU_ARCH) $(INCLUDES) $(LIBS) -O3 -dc $< -o $@
$(BIN)/%: $(OBJ)/%.o
$(NVCC) $(SM_TARGETS) -lcurand $^ -o $@
setup:
if [ ! -d "cub" ]; then \
wget https://github.com/NVlabs/cub/archive/1.6.4.zip; \
unzip 1.6.4.zip; \
mv cub-1.6.4 cub; \
rm 1.6.4.zip; \
fi
mkdir -p bin/ssb obj/ssb
mkdir -p bin/ops obj/ops
clean:
rm -rf bin/* obj/*