-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build for specific gpu architectures
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# make.device | ||
# add gpu specific compilation flags | ||
|
||
|
||
ifneq ($(findstring Kepler, $(GPU_TARGET)),) | ||
MIN_ARCH ?= 300 | ||
NV_SM += -gencode arch=compute_30,code=sm_30 | ||
NV_SM += -gencode arch=compute_35,code=sm_35 | ||
NV_COMP := -gencode arch=compute_35,code=compute_35 | ||
endif | ||
|
||
ifneq ($(findstring Maxwell, $(GPU_TARGET)),) | ||
MIN_ARCH ?= 500 | ||
NV_SM += -gencode arch=compute_50,code=sm_50 | ||
NV_SM += -gencode arch=compute_52,code=sm_52 | ||
NV_COMP := -gencode arch=compute_52,code=compute_52 | ||
endif | ||
|
||
ifneq ($(findstring Pascal, $(GPU_TARGET)),) | ||
MIN_ARCH ?= 600 | ||
NV_SM += -gencode arch=compute_60,code=sm_60 | ||
NV_SM += -gencode arch=compute_61,code=sm_61 | ||
NV_COMP := -gencode arch=compute_61,code=compute_61 | ||
endif | ||
|
||
ifneq ($(findstring Volta, $(GPU_TARGET)),) | ||
MIN_ARCH ?= 700 | ||
NV_SM += -gencode arch=compute_70,code=sm_70 | ||
NV_COMP := -gencode arch=compute_70,code=compute_70 | ||
endif | ||
|
||
ifneq ($(findstring Tesla, $(GPU_TARGET)),) | ||
MIN_ARCH ?= 750 | ||
NV_SM += -gencode arch=compute_75,code=sm_75 | ||
NV_COMP := -gencode arch=compute_75,code=compute_75 | ||
endif | ||
|
||
|
||
ifeq ($(NV_COMP),) | ||
$(error GPU_TARGET, is $(GPU_TARGET), must contain one or more of Kepler, Maxwell, Pascal, Volta, and Tesla) | ||
endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters