-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (23 loc) · 784 Bytes
/
Makefile
File metadata and controls
32 lines (23 loc) · 784 Bytes
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
CC = g++
NVCC = nvcc
CFLAGS = -std=c++11 -O3 -fopenmp
NVCCFLAGS = -std=c++11 -O3 -Xcompiler -fopenmp --use_fast_math -gencode arch=compute_70,code=sm_70
LDFLAGS = -lgmp
CUDA_LDFLAGS = -lcuda -lcudart -lgmp
SRC_DIR = src
BIN_DIR = bin
SEQ_TARGET = $(BIN_DIR)/miller_rabin_seq
PAR_TARGET = $(BIN_DIR)/miller_rabin_par
COMMON_SRC = $(SRC_DIR)/utils.cpp
SEQ_SRC = $(SRC_DIR)/miller_rabin_seq.cpp $(SRC_DIR)/miller_rabin_cpu.cpp
PAR_SRC = $(SRC_DIR)/miller_rabin_par.cu
all: dirs $(SEQ_TARGET) $(PAR_TARGET)
dirs:
mkdir -p $(BIN_DIR)
$(SEQ_TARGET): $(SEQ_SRC) $(COMMON_SRC)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
$(PAR_TARGET): $(PAR_SRC) $(COMMON_SRC) $(SRC_DIR)/miller_rabin_cpu.cpp
$(NVCC) $(NVCCFLAGS) -o $@ $^ $(CUDA_LDFLAGS)
clean:
rm -rf $(BIN_DIR)
.PHONY: all dirs clean