This is an automated email from the ASF dual-hosted git repository.
samskalicky pushed a commit to branch v1.x
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/v1.x by this push:
new e1bcb33 [1.x] Backport 'Update CUB and include it only for CUDA < 11
#18799' (#18975)
e1bcb33 is described below
commit e1bcb336fd7a12624481735cffcd9ef8529536a2
Author: Serge Panev <[email protected]>
AuthorDate: Mon Sep 14 18:12:38 2020 -0700
[1.x] Backport 'Update CUB and include it only for CUDA < 11 #18799'
(#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]>
---
3rdparty/nvidia_cub | 2 +-
CMakeLists.txt | 7 ++++++-
Makefile | 6 +++++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/3rdparty/nvidia_cub b/3rdparty/nvidia_cub
index c3cceac..0158fa1 160000
--- a/3rdparty/nvidia_cub
+++ b/3rdparty/nvidia_cub
@@ -1 +1 @@
-Subproject commit c3cceac115c072fb63df1836ff46d8c60d9eb304
+Subproject commit 0158fa19f28619886232defd412433974af89611
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b8adddc..8c7cfe1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
@@ -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)
diff --git a/Makefile b/Makefile
index 6a0a144..4ee71c9 100644
--- a/Makefile
+++ b/Makefile
@@ -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)