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

Commit

Permalink
[1.x] Backport 'Update CUB and include it only for CUDA < 11 #18799' (#…
Browse files Browse the repository at this point in the history
…18975)

* Update CUB and only for CUDA < 11 #18799 and update Makefile

Signed-off-by: Serge Panev <[email protected]>

* Add preprocessor option to silence CUB C++14 warning

Signed-off-by: Serge Panev <[email protected]>
  • Loading branch information
Kh4L authored Sep 15, 2020
1 parent 9383282 commit e1bcb33
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/nvidia_cub
Submodule nvidia_cub updated 105 files
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,12 @@ foreach(var ${C_CXX_INCLUDE_DIRECTORIES})
endforeach()

include_directories("include")
include_directories("3rdparty/nvidia_cub")
include_directories("3rdparty/tvm/nnvm/include")
include_directories("3rdparty/tvm/include")
include_directories("3rdparty/dmlc-core/include")
include_directories("3rdparty/dlpack/include")


# commented out until PR goes through
#if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/dlpack)
# add_subdirectory(3rdparty/dlpack)
Expand Down Expand Up @@ -641,6 +641,11 @@ if(USE_CUDA)
link_directories(${CUDAToolkit_LIBRARY_DIR})
endif()

if(CUDAToolkit_VERSION_MAJOR LESS "11")
include_directories("3rdparty/nvidia_cub")
add_definitions(-DCUB_IGNORE_DEPRECATED_CPP_DIALECT)
endif()

# unsupported: if caffe is a subdirectory of mxnet, load its CMakeLists.txt as well
if(USE_PLUGIN_CAFFE)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/caffe)
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,11 @@ LIB_DEP += $(DMLC_CORE)/libdmlc.a $(NNVM_PATH)/lib/libnnvm.a
ALL_DEP = $(OBJ) $(EXTRA_OBJ) $(PLUGIN_OBJ) $(LIB_DEP)

ifeq ($(USE_CUDA), 1)
CFLAGS += -I$(ROOTDIR)/3rdparty/nvidia_cub
CUDA_VERSION_MAJOR := $(shell $(NVCC) --version | grep "release" | awk '{print $$6}' | cut -c2- | cut -d '.' -f1)
ifeq ($(shell test $(CUDA_VERSION_MAJOR) -lt 11; echo $$?), 0)
CFLAGS += -I$(ROOTDIR)/3rdparty/nvidia_cub -DCUB_IGNORE_DEPRECATED_CPP_DIALECT
endif

ALL_DEP += $(CUOBJ) $(EXTRA_CUOBJ) $(PLUGIN_CUOBJ)
LDFLAGS += -lcufft
ifeq ($(ENABLE_CUDA_RTC), 1)
Expand Down

0 comments on commit e1bcb33

Please sign in to comment.