Skip to content

Commit

Permalink
Pass C++17 onto nvcc
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlees committed Mar 19, 2024
1 parent f507518 commit c4da289
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ else ifdef PROFILE
CUDAFLAGS = -O2 -pg -lineinfo
else
CXXFLAGS+= -O3 -flto -fno-fat-lto-objects -fvisibility=hidden
CUDAFLAGS = -O3
endif

UNAME_S := $(shell uname -s)
Expand All @@ -29,7 +30,7 @@ LDFLAGS+= -L$(LIBLOC)/lib
CUDA_LDLIBS=-lcudadevrt -lcudart_static $(LDLIBS)

CUDA_LDFLAGS =-L$(LIBLOC)/lib -L${CUDA_HOME}/targets/x86_64-linux/lib/stubs -L${CUDA_HOME}/targets/x86_64-linux/lib
CUDAFLAGS +=-Xcompiler -fPIC --cudart static --relocatable-device-code=true --expt-relaxed-constexpr -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75
CUDAFLAGS +=-Xcompiler -std=c++17 -Xcompiler -fPIC --cudart static --relocatable-device-code=true --expt-relaxed-constexpr -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75
ifdef GPU
CXXFLAGS += -DGPU_AVAILABLE
CUDAFLAGS += -gencode arch=compute_86,code=sm_86
Expand Down
3 changes: 2 additions & 1 deletion src/Makefile_fedora38
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ else ifdef PROFILE
else
CXXFLAGS+= -march=native -O3 -flto -fno-fat-lto-objects -fvisibility=hidden
CFLAGS+= -march=native -O3 -flto -fno-fat-lto-objects -fvisibility=hidden
CUDAFLAGS+= -O3
endif

UNAME_S := $(shell uname -s)
Expand All @@ -33,7 +34,7 @@ LDFLAGS+= -L$(LIBLOC)/lib -L"/home/linuxbrew/.linuxbrew/lib" -L/usr/local/cuda-1
CUDA_LDLIBS=-lcudadevrt -lcudart_static $(LDLIBS)

CUDA_LDFLAGS =-L$(LIBLOC)/lib -L${CUDA_HOME}/targets/x86_64-linux/lib/stubs -L${CUDA_HOME}/targets/x86_64-linux/lib
CUDAFLAGS +=-ccbin /home/linuxbrew/.linuxbrew/bin/g++-11 -Xcompiler -fPIC --cudart static --relocatable-device-code=true --expt-relaxed-constexpr -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75
CUDAFLAGS +=-ccbin /home/linuxbrew/.linuxbrew/bin/g++-11 -Xcompiler -std=c++17 -Xcompiler -fPIC --cudart static --relocatable-device-code=true --expt-relaxed-constexpr -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75
ifdef GPU
CXXFLAGS += -DGPU_AVAILABLE
CUDAFLAGS += -gencode arch=compute_86,code=sm_86
Expand Down

0 comments on commit c4da289

Please sign in to comment.