File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -155,8 +155,14 @@ if(WIN32)
155
155
endforeach ()
156
156
endif ()
157
157
158
- # NOTE(zhouwei): msvc max/min macro conflict with std::min/max, define NOMINMAX globally
158
+ # msvc max/min macro conflict with std::min/max, define NOMINMAX globally
159
159
add_definitions ("-DNOMINMAX" )
160
+
161
+ # 1. windows.h define 'small' cause CUDA11.6/11.7/11.8 's cub compile error,
162
+ # see https://github.com/microsoft/onnxruntime/issues/11227
163
+ # 2. WIN32_LEAN_AND_MEAN minimize the windows include files, avoid define 'small'
164
+ add_definitions (-DWIN32_LEAN_AND_MEAN )
165
+
160
166
# windows build turn off warnings, use parallel compiling.
161
167
foreach (
162
168
flag_var
Original file line number Diff line number Diff line change 14
14
15
15
include (ExternalProject )
16
16
17
- # Note(zhouwei): extern_cub has code __FILE_, If the path of extern_cub is changed,
17
+ # extern_cub has code __FILE_, If the path of extern_cub is changed,
18
18
# it will effect about 30+ cu files sccache hit and slow compile speed on windows.
19
19
# Therefore, a fixed CUB_PATH will be input to increase the sccache hit rate.
20
20
set (CUB_PATH
@@ -25,7 +25,7 @@ set(CUB_PREFIX_DIR ${CUB_PATH})
25
25
set (CUB_REPOSITORY ${GIT_URL} /NVlabs/cub.git )
26
26
27
27
if (${CMAKE_CUDA_COMPILER_VERSION} GREATER_EQUAL 11.6 )
28
- # cuda_11.6.2_511.65 ‘s own cub is 1.15.0, which will cause compiling error in windows.
28
+ # cuda_11.6/11.7/11.8 ‘s own cub is 1.15.0, which will cause compiling error in windows.
29
29
set (CUB_TAG 1.16.0 )
30
30
# cub 1.16.0 is not compitable with current thrust version
31
31
add_definitions (-DTHRUST_IGNORE_CUB_VERSION_CHECK )
Original file line number Diff line number Diff line change @@ -317,8 +317,7 @@ if(WITH_ONNXRUNTIME)
317
317
endif ()
318
318
319
319
if (WITH_GPU )
320
- if (${CMAKE_CUDA_COMPILER_VERSION} LESS 11.0 OR ${CMAKE_CUDA_COMPILER_VERSION}
321
- GREATER_EQUAL 11.6 )
320
+ if (${CMAKE_CUDA_COMPILER_VERSION} LESS 11.0 )
322
321
include (external/cub ) # download cub
323
322
list (APPEND third_party_deps extern_cub )
324
323
endif ()
You can’t perform that action at this time.
0 commit comments