Skip to content

Commit eb851a5

Browse files
authored
Fix Windows CUDA build: guard extension_cuda compile options to CXX (#20184)
Guard extension_cuda's ${_common_compile_options} with $<COMPILE_LANGUAGE:CXX> so the MSVC /wd4996 flag no longer leaks (via slimtensor INTERFACE, added in #20158) into the aoti_cuda_shims .cu nvcc compile, which failed with 'nvcc fatal: A single input file is required'. Also run the cuda-windows workflow on extension/cuda changes. Verified: Windows CUDA e2e 5/6 green (was 0/6).
1 parent a1649b9 commit eb851a5

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/cuda-windows.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
- .github/workflows/cuda-windows.yml
1717
- backends/cuda/**
1818
- backends/aoti/**
19+
- extension/cuda/**
1920
workflow_dispatch:
2021

2122
concurrency:
@@ -49,6 +50,7 @@ jobs:
4950
(
5051
contains(needs.changed-files.outputs.changed-files, 'backends/cuda') ||
5152
contains(needs.changed-files.outputs.changed-files, 'backends/aoti') ||
53+
contains(needs.changed-files.outputs.changed-files, 'extension/cuda') ||
5254
contains(needs.changed-files.outputs.changed-files, '.github/workflows/cuda-windows.yml') ||
5355
needs.run-decision.outputs.is-full-run == 'true'
5456
)
@@ -150,6 +152,7 @@ jobs:
150152
(
151153
contains(needs.changed-files.outputs.changed-files, 'backends/cuda') ||
152154
contains(needs.changed-files.outputs.changed-files, 'backends/aoti') ||
155+
contains(needs.changed-files.outputs.changed-files, 'extension/cuda') ||
153156
contains(needs.changed-files.outputs.changed-files, '.github/workflows/cuda-windows.yml') ||
154157
needs.run-decision.outputs.is-full-run == 'true'
155158
)

extension/cuda/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ find_package(CUDAToolkit REQUIRED)
2525
add_library(extension_cuda SHARED caller_stream.cpp)
2626
target_link_libraries(extension_cuda PUBLIC CUDA::cudart)
2727
target_include_directories(extension_cuda PUBLIC ${_common_include_directories})
28-
target_compile_options(extension_cuda PUBLIC ${_common_compile_options})
28+
target_compile_options(
29+
extension_cuda PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${_common_compile_options}>"
30+
)
2931
target_compile_definitions(
3032
extension_cuda PRIVATE EXECUTORCH_EXTENSION_CUDA_BUILDING
3133
)

0 commit comments

Comments
 (0)