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

Commit

Permalink
Update CUB and only for CUDA < 11 #18799 and update Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Serge Panev <[email protected]>
  • Loading branch information
Kh4L committed Sep 11, 2020
1 parent 9445a2d commit 74d1535
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/nvidia_cub
Submodule nvidia_cub updated 105 files
6 changes: 5 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,10 @@ if(USE_CUDA)
link_directories(${CUDAToolkit_LIBRARY_DIR})
endif()

if(CUDAToolkit_VERSION_MAJOR LESS "11")
include_directories("3rdparty/nvidia_cub")
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
endif

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

0 comments on commit 74d1535

Please sign in to comment.