Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
C++17 for CUDA code
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrendx committed Jun 26, 2020
1 parent d889bdc commit b09090c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/mshadow/make/mshadow.mk
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ PS_LIB = $(addprefix $(PS_PATH)/build/, libps.a libps_main.a) \
$(addprefix $(PS_THIRD_PATH)/lib/, libgflags.a libzmq.a libprotobuf.a \
libglog.a libz.a libsnappy.a)
# -L$(PS_THIRD_PATH)/lib -lgflags -lzmq -lprotobuf -lglog -lz -lsnappy
MSHADOW_NVCCFLAGS += --std=c++14
MSHADOW_NVCCFLAGS += --std=c++17
else
MSHADOW_CFLAGS+= -DMSHADOW_DIST_PS=0
endif
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ endif
# -L/usr/local/lib

ifeq ($(DEBUG), 1)
NVCCFLAGS += -std=c++14 -Xcompiler -D_FORCE_INLINES -g -G -O0 -ccbin $(CXX) $(MSHADOW_NVCCFLAGS)
NVCCFLAGS += -std=c++17 -Xcompiler -D_FORCE_INLINES -g -G -O0 -ccbin $(CXX) $(MSHADOW_NVCCFLAGS)
else
NVCCFLAGS += -std=c++14 -Xcompiler -D_FORCE_INLINES -O3 -ccbin $(CXX) $(MSHADOW_NVCCFLAGS)
NVCCFLAGS += -std=c++17 -Xcompiler -D_FORCE_INLINES -O3 -ccbin $(CXX) $(MSHADOW_NVCCFLAGS)
endif

# CFLAGS for segfault logger
Expand Down Expand Up @@ -693,7 +693,7 @@ build/libtransposerowsp_lib.so:
build/libcustomop_gpu_lib.so:
@mkdir -p $(@D)
$(NVCC) -shared -std=c++11 -Xcompiler -fPIC example/extensions/lib_custom_op/relu_lib.cu -o /dev/null -I include/mxnet
$(NVCC) -shared -std=c++14 -Xcompiler -fPIC example/extensions/lib_custom_op/relu_lib.cu -o $@ -I include/mxnet
$(NVCC) -shared -std=c++17 -Xcompiler -fPIC example/extensions/lib_custom_op/relu_lib.cu -o $@ -I include/mxnet
build/libsubgraph_lib.so:
@mkdir -p $(@D)
$(CXX) -shared -fPIC -std=c++11 example/extensions/lib_subgraph/subgraph_lib.cc -o /dev/null -I include/mxnet
Expand Down
2 changes: 1 addition & 1 deletion src/common/cuda/rtc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ CUfunction get_function(const std::string &code,

std::string gpu_arch_arg = "--gpu-architecture=compute_" + std::to_string(sm_arch);
const char *opts[] = {gpu_arch_arg.c_str(),
"--std=c++11"};
"--std=c++14"};
const std::string kernel_name_demangled = kernel_name;
NVRTC_CALL(nvrtcAddNameExpression(program, (kernel_name_demangled).c_str()));

Expand Down

0 comments on commit b09090c

Please sign in to comment.