File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -591,8 +591,9 @@ endif()
591591if (EXECUTORCH_BUILD_CUDA)
592592 # Build CUDA-specific AOTI functionality
593593 add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/cuda)
594- # Add aoti_cuda to backends - it already depends on aoti_common
595- list (APPEND _executorch_backends aoti_cuda)
594+ # Add aoti_cuda_backend to backends - it transitively includes aoti_cuda_shims
595+ # and cuda_platform
596+ list (APPEND _executorch_backends aoti_cuda_backend)
596597endif ()
597598
598599if (EXECUTORCH_BUILD_METAL)
Original file line number Diff line number Diff line change @@ -168,13 +168,21 @@ target_link_options(
168168 $<$<NOT :$<CXX_COMPILER_ID:MSVC >>:-Wl,--export-dynamic>
169169)
170170
171- # Link against shims library and other dependencies
171+ # Link against shims library and other dependencies On Windows (MSVC), use
172+ # PRIVATE linkage for aoti_cuda_shims since the DLL is copied to the executable
173+ # directory. On other platforms, use PUBLIC so the dependency propagates to
174+ # consumers.
172175target_link_libraries (
173- aoti_cuda_backend
174- PRIVATE aoti_cuda_shims cuda_platform
175- PUBLIC extension_tensor cuda_tensor_maker CUDA::cudart ${CMAKE_DL_LIBS}
176+ aoti_cuda_backend PUBLIC cuda_platform extension_tensor cuda_tensor_maker
177+ CUDA::cudart ${CMAKE_DL_LIBS}
176178)
177179
180+ if (MSVC )
181+ target_link_libraries (aoti_cuda_backend PRIVATE aoti_cuda_shims)
182+ else ()
183+ target_link_libraries (aoti_cuda_backend PUBLIC aoti_cuda_shims)
184+ endif ()
185+
178186executorch_target_link_options_shared_lib(aoti_cuda_backend)
179187
180188install (
You can’t perform that action at this time.
0 commit comments