@@ -194,15 +194,23 @@ else()
194194endif ()
195195# Shared CUDA compile options (excluding --threads, which is set per-target so that
196196# flash attention can use a lower thread count without duplicate-flag nvcc warnings).
197+ # These mirror the options from the parent plugin target and config_cuda_provider_shared_module
198+ # so that OBJECT libraries compiled separately receive the same flags.
197199set (_cuda_plugin_shared_compile_options
200+ # Force NVCC onto C++20 explicitly. With the VS generator the CUDA_STANDARD
201+ # property alone still leaves `-std=c++17` in AdditionalOptions.
202+ "$<$<COMPILE_LANGUAGE :CUDA >:SHELL :--std c ++20>"
198203 "$<$<COMPILE_LANGUAGE :CUDA >:--diag -suppress =177>"
204+ # Suppress cudafe front-end diagnostic 550 (variable set but never used) from third-party headers.
205+ "$<$<COMPILE_LANGUAGE :CUDA >:SHELL :-Xcudafe --diag_suppress =550>"
206+ # Suppress cudafe [[nodiscard]] false positive on Status assignments.
207+ "$<$<COMPILE_LANGUAGE :CUDA >:SHELL :-Xcudafe --diag_suppress =2810>"
199208)
200209
201210if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8)
202211 list (APPEND _cuda_plugin_shared_compile_options
203212 "$<$<COMPILE_LANGUAGE :CUDA >:--static -global -template -stub =false >"
204213 "$<$<COMPILE_LANGUAGE :CUDA >:--diag -suppress =221>"
205- "$<$<COMPILE_LANGUAGE :CUDA >:--diag -suppress =2810>"
206214 "$<$<COMPILE_LANGUAGE :CUDA >:--diag -suppress =2908>"
207215 )
208216
@@ -213,6 +221,17 @@ if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8)
213221 endif ()
214222endif ()
215223
224+ if (MSVC )
225+ list (APPEND _cuda_plugin_shared_compile_options
226+ "$<$<COMPILE_LANGUAGE :CUDA >:SHELL :-Xcompiler /permissive >"
227+ "$<$<COMPILE_LANGUAGE :CUDA >:SHELL :-Xcompiler /wd4834 >"
228+ "$<$<COMPILE_LANGUAGE :CUDA >:SHELL :-Xcompiler /wd4127 >"
229+ "$<$<COMPILE_LANGUAGE :CUDA >:SHELL :-Xcompiler /wd4211 >"
230+ "$<$<COMPILE_LANGUAGE :CUDA >:SHELL :-Xcompiler /Zc :__cplusplus >"
231+ "$<$<COMPILE_LANGUAGE :CUDA >:SHELL :-Xcompiler /bigobj >"
232+ )
233+ endif ()
234+
216235include (cudnn_frontend )
217236include (cutlass )
218237
0 commit comments