forked from lattice/quda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.inc.example
54 lines (41 loc) · 1.4 KB
/
make.inc.example
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
42
43
44
45
46
47
48
49
50
51
52
53
54
###### Local configuration:
CUDA_INSTALL_PATH = /usr/local/cuda
CPU_ARCH = x86_64 # x86 or x86_64
GPU_ARCH = sm_13 # sm_10, sm_11, sm_12, sm_13, or sm_20
GPU_EMU = false # set to 'true' for device emulation
PYTHON = python # python 2.5 or later required for 'make gen'
DEVICE = 0 # CUDA device to use for 'make tune'
BUILD_3D = false # set to 'true' to build 3D Dslash
######
INC = -I$(CUDA_INSTALL_PATH)/include
CUDA_VERSION = $(shell awk '/\#define CUDA_VERSION/{print $$3}' \
$(CUDA_INSTALL_PATH)/include/cuda.h)
OPT = -DCUDA_VERSION=$(CUDA_VERSION)
OPT += -D__CUDA_ARCH__=$(GPU_ARCH:sm_%=%0)
ifeq ($(strip $(CPU_ARCH)), x86_64)
LIB = -L$(CUDA_INSTALL_PATH)/lib64 -lcudart # for release 2.3 and later
# LIB = -L$(CUDA_INSTALL_PATH)/lib -lcudart # for release 2.2 and earlier
COPT =
else
LIB = -L$(CUDA_INSTALL_PATH)/lib -lcudart
COPT = -malign-double
endif
ifeq ($(strip $(GPU_EMU)), true)
COPT += -D__DEVICE_EMULATION__
NVCCOPT = -deviceemu
endif
ifeq ($(strip $(BUILD_3D)), true)
OPT += -DBUILD_3D_DSLASH
endif
ifeq ($(strip $(GPU_ARCH)), sm_20)
NVCCOPT += -ftz=true -prec-div=false -prec-sqrt=false
endif
COPT += $(OPT)
NVCCOPT += $(OPT)
CC = gcc
CFLAGS = -Wall -O3 -std=c99 $(COPT) $(INC)
CXX = g++
CXXFLAGS = -Wall -O3 $(COPT) $(INC)
NVCC = $(CUDA_INSTALL_PATH)/bin/nvcc
NVCCFLAGS = -O3 $(NVCCOPT) -arch=$(GPU_ARCH) $(INC)
LDFLAGS = -fPIC $(LIB)