-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
40 lines (28 loc) · 1.01 KB
/
makefile
File metadata and controls
40 lines (28 loc) · 1.01 KB
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
OUTPUT_FOLDER = bin
SAMPLE_INPUT = src/sample
SAMPLE_OUTPUT = bin/sample
SERIAL_FOLDER = src/serial
OPEN_MPI_FOLDER = src/open-mpi
OPEN_MP_FOLDER = src/open-mp
CUDA_FOLDER = src/cuda
all: sample serial parallel
serial:
gcc $(SERIAL_FOLDER)/c/serial.c -o $(OUTPUT_FOLDER)/serial -lm
serial-cpp:
g++ $(SERIAL_FOLDER)/c++/serial.cpp -o $(OUTPUT_FOLDER)/serial -lm
parallel: parallel-mpi parallel-mp parallel-cuda
parallel-mpi:
mpicc $(OPEN_MPI_FOLDER)/mpi.c -o $(OUTPUT_FOLDER)/mpi -lm
parallel-mp:
gcc $(OPEN_MP_FOLDER)/mp.c --openmp -o $(OUTPUT_FOLDER)/mp -lm
parallel-cuda:
nvcc $(CUDA_FOLDER)/cuda.cu -o $(OUTPUT_FOLDER)/cuda -arch=sm_86 -rdc=true -lcudadevrt
sample: sample-mpi sample-mp sample-cuda
sample-mpi:
mkdir -p $(SAMPLE_OUTPUT) && mpicc $(SAMPLE_INPUT)/mpi.c -o $(SAMPLE_OUTPUT)/mpi
sample-mp:
mkdir -p $(SAMPLE_OUTPUT) && gcc $(SAMPLE_INPUT)/mp.c -fopenmp -o $(SAMPLE_OUTPUT)/mp
sample-cuda:
mkdir -p $(SAMPLE_OUTPUT) && nvcc $(SAMPLE_INPUT)/cuda.cu -o $(SAMPLE_OUTPUT)/cuda
clean:
rm $(OUTPUT_FOLDER)/*