forked from ecrc/kblas-gpu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.inc
84 lines (68 loc) · 1.92 KB
/
make.inc
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#
# @copyright (c) 2012- King Abdullah University of Science and
# Technology (KAUST). All rights reserved.
#
#
# @file make.inc
#
# KBLAS is a high performance CUDA library for subset of BLAS
# and LAPACK routines optimized for NVIDIA GPUs.
# KBLAS is provided by KAUST.
#
# @version 2.0.0
# @author Ali Charara
# @author Ahmad Abdelfattah
# @date 2017-11-13
#
#-----------------------------------------
_SUPPORT_BLAS2_=TRUE
_SUPPORT_BLAS3_=TRUE
_SUPPORT_BATCH_TR_=TRUE
_SUPPORT_SVD_=TRUE
#-----------------------------------------
_USE_MKL_=TRUE
_USE_MAGMA_=TRUE
#-----------------------------------------
#specify cuda directory
_CUDA_ROOT_=$(CUDA_ROOT)
_CUDA_ARCH_ ?= 35
# specify compilers
CXX ?= g++
CC ?= gcc
NVCC=$(_CUDA_ROOT_)/bin/nvcc
#customize the name of the static kblas library
LIB_KBLAS_NAME=kblas-gpu
#-----------------------------------------
NVOPTS =-O3 --compiler-options -fno-strict-aliasing
COPTS = -std=c99 -openmp
NVOPTS_3 = -DSM=$(_CUDA_ARCH_) -arch sm_$(_CUDA_ARCH_) -Xcompiler -fopenmp
#-----------------------------------------
ifdef _SUPPORT_SVD_
_CUB_DIR_?=$(HOME)/cub
#COPTS += -DSUPPORT_SVD -D__NO_NCCL__
#NVOPTS += -DSUPPORT_SVD -D__NO_NCCL__
endif
#-----------------------------------------
ifdef _USE_MAGMA_
COPTS += -DUSE_MAGMA
_MAGMA_ROOT_?=$(HOME)/magma
NVOPTS += -DUSE_MAGMA
endif
#-----------------------------------------
ifdef _SUPPORT_BLAS2_
# specify the gpu architecture for BLAS2 routines (fermi, kepler)
GPU_ARCH_2=kepler
ifeq (${GPU_ARCH_2}, kepler)
NVOPTS_2 = -DSM=35 -arch sm_35
else ifeq (${GPU_ARCH_2}, fermi)
NVOPTS_2 = -DSM=20 -arch sm_20
else
$(error GPU_ARCH_2, currently ${GPU_TARGET_2}, must be either fermi or kepler for BLAS2 routines. Please edit your make.inc file)
endif
endif #_SUPPORT_BLAS2_
#-----------------------------------------
ifdef _USE_MKL_
COPTS += -DUSE_MKL
NVOPTS += -DUSE_MKL
_MKL_ROOT_=${MKLROOT}
endif