Skip to content

Commit 75fb249

Browse files
authored
add cuda allocator to cmake target (pytorch#19764) (pytorch#19764)
Summary: Pull Request resolved: pytorch#19764 Reviewed By: kirklandsign Differential Revision: D106332819
1 parent 5fc929f commit 75fb249

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

backends/cuda/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ install(
103103
)
104104

105105
# CUDA-specific AOTI shim symbols (dynamically linked)
106-
set(_aoti_cuda_shim_sources runtime/shims/memory.cpp
106+
set(_aoti_cuda_shim_sources runtime/cuda_allocator.cpp runtime/shims/memory.cpp
107107
runtime/shims/cuda_guard.cpp
108108
)
109109

@@ -180,8 +180,12 @@ install(
180180

181181
# CUDA backend implementation
182182
set(_aoti_cuda_backend_sources runtime/cuda_backend.cpp)
183+
if(_cuda_is_msvc_toolchain)
184+
# MSVC links aoti_cuda_backend into portable_lib without relying on C++
185+
# symbols exported from aoti_cuda_shims.dll.
186+
list(APPEND _aoti_cuda_backend_sources runtime/cuda_allocator.cpp)
187+
endif()
183188

184-
# CUDA backend implementation
185189
add_library(aoti_cuda_backend STATIC ${_aoti_cuda_backend_sources})
186190

187191
target_include_directories(

0 commit comments

Comments
 (0)