forked from UoB-HPC/BabelStream
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCUDA.make
More file actions
40 lines (29 loc) · 691 Bytes
/
CUDA.make
File metadata and controls
40 lines (29 loc) · 691 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
33
34
35
36
37
38
39
CXXFLAGS=-O3
CUDA_CXX=nvcc
ifndef NVARCH
define nvarch_help
Set NVARCH to select sm_?? version.
Default: sm_60
endef
$(info $(nvarch_help))
NVARCH=sm_60
endif
ifndef MEM
define mem_help
Set MEM to select memory mode.
Available options:
DEFAULT - allocate host and device memory pointers.
MANAGED - use CUDA Managed Memory.
PAGEFAULT - shared memory, only host pointers allocated.
endef
$(info $(mem_help))
MEM=DEFAULT
endif
MEM_MANAGED= -DMANAGED
MEM_PAGEFAULT= -DPAGEFAULT
MEM_MODE = $(MEM_$(MEM))
cuda-stream: main.cpp CUDAStream.cu
$(CUDA_CXX) -std=c++11 $(CXXFLAGS) -arch=$(NVARCH) $(MEM_MODE) -DCUDA $^ $(EXTRA_FLAGS) -o $@
.PHONY: clean
clean:
rm -f cuda-stream