Fix CUDA 11.6 build error on Windows (#11578)

* Avoid windows header that defines 'small'
This commit is contained in:
Scott McKay 2022-05-28 08:04:46 +10:00 committed by GitHub
parent 7e6d052275
commit 4fabc400de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -476,6 +476,10 @@ if (onnxruntime_USE_CUDA)
"${ONNXRUNTIME_ROOT}/core/providers/cuda/cuda_pch.cc"
)
# minimize the Windows includes.
# this avoids an issue with CUDA 11.6 where 'small' is defined in the windows and cuda headers.
target_compile_definitions(onnxruntime_providers_cuda PRIVATE "WIN32_LEAN_AND_MEAN")
# disable a warning from the CUDA headers about unreferenced local functions
#target_compile_options(onnxruntime_providers_cuda PRIVATE /wd4505)
if (onnxruntime_USE_NUPHAR_TVM)