Skip to content

Commit

Permalink
updates configuration, adds option for cuda9 (Volta)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeter committed Dec 12, 2017
1 parent 104b584 commit 2d6c572
Show file tree
Hide file tree
Showing 7 changed files with 286 additions and 45 deletions.
38 changes: 30 additions & 8 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ SCOTCH_FLAGS = @FC_DEFINE@USE_SCOTCH $(SCOTCH_INC)
@COND_CUDA_TRUE@CUDA = yes
@COND_CUDA_FALSE@CUDA = no

# CUDA version 5x & 6x
@COND_CUDA5_TRUE@CUDA5 = yes
@COND_CUDA5_FALSE@CUDA5 = no

Expand All @@ -121,12 +120,18 @@ SCOTCH_FLAGS = @FC_DEFINE@USE_SCOTCH $(SCOTCH_INC)
@COND_CUDA7_TRUE@CUDA7 = yes
@COND_CUDA7_FALSE@CUDA7 = no

@COND_CUDA8_TRUE@CUDA8 = yes
@COND_CUDA8_FALSE@CUDA8 = no

@COND_CUDA8_TRUE@CUDA9 = yes
@COND_CUDA8_FALSE@CUDA9 = no

# CUDA compilation with linking
@COND_CUDA_PLUS_TRUE@CUDA_PLUS = yes
@COND_CUDA_PLUS_FALSE@CUDA_PLUS = no

# default cuda libraries
# runtime library -lcudart -lcuda and -lcublas needed
# runtime library -lcudart needed, others are optional -lcuda -lcublas

CUDA_FLAGS = @CUDA_FLAGS@
CUDA_INC = @CUDA_CPPFLAGS@ -I${SETUP}
Expand All @@ -144,18 +149,27 @@ CUDA_LINK = @CUDA_LDFLAGS@ @CUDA_LIBS@ -lstdc++
# Kepler (cuda5) : -gencode=arch=compute_35,code=sm_35
# Kepler (cuda6.5,K80): -gencode=arch=compute_37,code=sm_37
# Maxwell (cuda6.5+/cuda7,Quadro K2200): -gencode=arch=compute_50,code=sm_50
# Pascal (cuda8,P100): -gencode=arch=compute_60,code=sm_60
# Volta (cuda9,V100): -gencode=arch=compute_70,code=sm_70
GENCODE_20 = -gencode=arch=compute_20,code=\"sm_20,compute_20\"
GENCODE_30 = -gencode=arch=compute_30,code=\"sm_30,compute_30\"
GENCODE_35 = -gencode=arch=compute_35,code=\"sm_35,compute_35\"
GENCODE_37 = -gencode=arch=compute_37,code=\"sm_37\"
GENCODE_50 = -gencode=arch=compute_50,code=\"sm_50\"

GENCODE_60 = -gencode=arch=compute_60,code=\"sm_60,compute_60\"
GENCODE_70 = -gencode=arch=compute_70,code=\"sm_70,compute_70\"

# cuda preprocessor flag
# CUDA version 9.0
@COND_CUDA_TRUE@@COND_CUDA8_TRUE@GENCODE = $(GENCODE_70) $(FC_DEFINE)GPU_DEVICE_Volta
# CUDA version 8.0
@COND_CUDA_TRUE@@COND_CUDA8_TRUE@GENCODE = $(GENCODE_60) $(FC_DEFINE)GPU_DEVICE_Pascal
# CUDA version 7.x
@COND_CUDA_TRUE@@COND_CUDA7_TRUE@GENCODE = $(GENCODE_50)
@COND_CUDA_TRUE@@COND_CUDA7_TRUE@GENCODE = $(GENCODE_50) $(FC_DEFINE)GPU_DEVICE_Maxwell
# CUDA version 6.5
@COND_CUDA_TRUE@@COND_CUDA6_TRUE@GENCODE = $(GENCODE_37)
@COND_CUDA_TRUE@@COND_CUDA6_TRUE@GENCODE = $(GENCODE_37) $(FC_DEFINE)GPU_DEVICE_K80
# CUDA version 5.x
@COND_CUDA_TRUE@@COND_CUDA5_TRUE@GENCODE = $(GENCODE_35)
@COND_CUDA_TRUE@@COND_CUDA5_TRUE@GENCODE = $(GENCODE_35) $(FC_DEFINE)GPU_DEVICE_K20
# CUDA version 4.x
@COND_CUDA_TRUE@@COND_CUDA_PLUS_FALSE@GENCODE = $(GENCODE_20)

Expand Down Expand Up @@ -292,10 +306,18 @@ help:

#######################################

${SETUP}/version.fh: @GIT_VERSION_DEPS@
@echo "GEN $@"
@echo "! This file is generated by Make. Do not edit this file!" > $@
@echo "character(len=*), parameter :: git_version = \"$$(cd ${S_TOP} && git describe --tags)\"" >> $@

#######################################


# Get dependencies and rules for building stuff
include $(patsubst %, ${S_TOP}/src/%/rules.mk, $(SUBDIRS))


#######################################

##
Expand Down Expand Up @@ -323,6 +345,6 @@ $(foreach dir, $(SUBDIRS), $(eval $(call shortcut,$(dir))))
test : tests

# Other old shortcuts
mesh : $E/xmeshfem2D
spec : $E/xspecfem2D
mesh: $E/xmeshfem2D
spec: $E/xspecfem2D
.PHONY: mesh spec
Loading

0 comments on commit 2d6c572

Please sign in to comment.