Skip to content

Commit

Permalink
Resolve CUDA 9 compile errors due to gencode flags
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianSlzr committed Dec 6, 2017
1 parent de032cb commit 50b53d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gpucompute/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ all: $(LIBFILE)
ifeq ($(CUDA), true)

#Default compute capability architectures we compile with
CUDA_ARCH=-gencode arch=compute_20,code=sm_20
CUDA_ARCH=

#Get the CUDA Toolkit version (remove decimal point char)
CUDA_VERSION=$(shell $(CUDATKDIR)/bin/nvcc -V | grep release | sed -e 's|.*release ||' -e 's|,.*||' -e 's|\.||')
Expand Down Expand Up @@ -72,6 +72,12 @@ ifeq ($(CUDA), true)
-gencode arch=compute_10,code=sm_10
endif

#For toolkit older than 9.0, add the compute capability 2.0
CUDA_VER_GT_9_0 := $(shell [ $(CUDA_VERSION) -ge 90 ] && echo true)
ifneq ($(CUDA_VER_GT_9_0), true)
CUDA_ARCH += -gencode arch=compute_20,code=sm_20
endif

endif


Expand Down

0 comments on commit 50b53d3

Please sign in to comment.