-
Notifications
You must be signed in to change notification settings - Fork 4
/
samples_common.mk
44 lines (38 loc) · 1.07 KB
/
samples_common.mk
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
#Setting SMS for all samples
#architecture
CUDA_VERSION := $(shell cat $(CUDA_PATH)/include/cuda.h |grep "define CUDA_VERSION" |awk '{print $$3}')
$(info CUDA_VERSION is ${CUDA_VERSION})
#Link against cublasLt for CUDA 10.1 and up.
CUBLASLT:=false
ifeq ($(shell test $(CUDA_VERSION) -ge 10010; echo $$?),0)
CUBLASLT:=true
endif
$(info Linking agains cublasLt = $(CUBLASLT))
ifeq ($(CUDA_VERSION),8000)
SMS_VOLTA =
else
ifneq ($(TARGET_ARCH), ppc64le)
ifeq ($(CUDA_VERSION), $(filter $(CUDA_VERSION), 9000 9010 9020))
SMS_VOLTA ?= 70
else
ifeq ($(TARGET_OS), darwin)
SMS_VOLTA ?= 70
else
SMS_VOLTA ?= 70 72 75
endif #ifneq ($(TARGET_OS), darwin)
endif #ifeq ($(CUDA_VERSION), $(filter $(CUDA_VERSION), 9000 9010 9020))
else
SMS_VOLTA ?= 70
endif #ifneq ($(TARGET_ARCH), ppc64le)
endif #ifeq ($(CUDA_VERSION),8000 )
SMS_AMPERE =
ifeq ($(shell expr $(CUDA_VERSION) \>= 11000),1)
SMS_AMPERE = 80
endif
ifeq ($(shell expr $(CUDA_VERSION) \>= 11010),1)
SMS_AMPERE += 86
endif
ifeq ($(shell expr $(CUDA_VERSION) \>= 11042),1)
SMS_AMPERE += 87
endif
SMS ?= 35 50 53 60 61 62 $(SMS_VOLTA) $(SMS_AMPERE)