Skip to content

Commit 4baaf8e

Browse files
author
betterpig
committed
cherry pick 43934 and not format
1 parent dc12605 commit 4baaf8e

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

cmake/external/cub.cmake

+9-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ set(CUB_PATH "${THIRD_PARTY_PATH}/cub" CACHE STRING "A path setting for e
2121
set(CUB_PREFIX_DIR ${CUB_PATH})
2222

2323
set(CUB_REPOSITORY ${GIT_URL}/NVlabs/cub.git)
24-
set(CUB_TAG 1.8.0)
24+
25+
if(WIN32 AND ${CMAKE_CUDA_COMPILER_VERSION} GREATER_EQUAL 11.6)
26+
# cuda_11.6.2_511.65‘s own cub is 1.15.0, which will cause compiling error in windows.
27+
set(CUB_TAG 1.16.0)
28+
# cub 1.16.0 is not compitable with current thrust version
29+
add_definitions(-DTHRUST_IGNORE_CUB_VERSION_CHECK)
30+
else()
31+
set(CUB_TAG 1.8.0)
32+
endif()
2533

2634
SET(CUB_INCLUDE_DIR ${CUB_PREFIX_DIR}/src/extern_cub)
2735
message("CUB_INCLUDE_DIR is ${CUB_INCLUDE_DIR}")

cmake/third_party.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ if(WITH_ONNXRUNTIME)
257257
endif()
258258

259259
if(WITH_GPU)
260-
if (${CMAKE_CUDA_COMPILER_VERSION} LESS 11.0)
260+
if (${CMAKE_CUDA_COMPILER_VERSION} LESS 11.0 OR ${CMAKE_CUDA_COMPILER_VERSION}
261+
GREATER_EQUAL 11.6)
261262
include(external/cub) # download cub
262263
list(APPEND third_party_deps extern_cub)
263264
endif()

0 commit comments

Comments
 (0)