Skip to content

Commit 4985a9f

Browse files
committed
update linux build
1 parent 67d3bb2 commit 4985a9f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmake/external/cub.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,20 @@ set(CUB_PREFIX_DIR ${CUB_PATH})
2424

2525
set(CUB_SOURCE_DIR ${PADDLE_SOURCE_DIR}/third_party/cub)
2626

27-
if(NOT WITH_GPU)
28-
set(CUB_TAG 1.8.0)
27+
if(${CMAKE_CUDA_COMPILER_VERSION} GREATER_EQUAL 11.6)
28+
# cuda_11.6/11.7/11.8‘s own cub is 1.15.0, which will cause compiling error in windows.
29+
set(CUB_TAG 2.1.0)
2930
execute_process(COMMAND git --git-dir=${CUB_SOURCE_DIR}/.git
3031
--work-tree=${CUB_SOURCE_DIR} checkout ${CUB_TAG})
31-
else()
3232
# cub 2.1.0 is not compatible with current thrust version
3333
add_definitions(-DTHRUST_IGNORE_CUB_VERSION_CHECK)
3434
if(${CMAKE_CUDA_COMPILER_VERSION} EQUAL 11.8)
3535
set(cub_patches "${PADDLE_SOURCE_DIR}/patches/cub")
3636
message(STATUS "Add cub patches: ${cub_patches}")
3737
include_directories(${cub_patches})
3838
endif()
39+
else()
40+
set(CUB_TAG 1.8.0)
3941
endif()
4042

4143
set(CUB_INCLUDE_DIR ${CUB_SOURCE_DIR})

0 commit comments

Comments
 (0)