Skip to content

Commit d5c70d5

Browse files
committed
Fix plugin CI
1 parent 41e2974 commit d5c70d5

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

cmake/onnxruntime_providers_cuda.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@
239239
# cutlass-src\include\cute/arch/mma_sm120.hpp(3128): error #177-D: variable "tidA" was declared but never
240240
# referenced
241241
target_compile_options(${target} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:--diag-suppress=177>")
242+
# suppress cudafe "variable was set but never used" (#550-D) from flatbuffers/adapter headers
243+
target_compile_options(${target} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcudafe --diag_suppress=550>")
242244
243245
# Since CUDA 12.8, compiling diagnostics become stricter
244246
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8)

cmake/onnxruntime_providers_cuda_plugin.cmake

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,23 @@ else()
194194
endif()
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.
197199
set(_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

201210
if (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()
214222
endif()
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+
216235
include(cudnn_frontend)
217236
include(cutlass)
218237

0 commit comments

Comments
 (0)