Revert "export AOTI_TORCH_EXPORT on Windows. (#140030)"

This reverts commit daed864f7b3ca3b3e64ed13624369fd3007ad47d.

Reverted https://github.com/pytorch/pytorch/pull/140030 on behalf of https://github.com/xuhancn due to need to fix on XPU. ([comment](https://github.com/pytorch/pytorch/pull/140030#issuecomment-2510737212))
This commit is contained in:
PyTorch MergeBot
2024-12-02 07:10:41 +00:00
parent 8cada5cbe5
commit 90f4d60672
2 changed files with 2 additions and 8 deletions

View File

@ -779,7 +779,6 @@ endif()
if(NOT BUILD_LIBTORCHLESS)
add_library(torch_cpu ${Caffe2_CPU_SRCS})
target_compile_definitions(torch_cpu PRIVATE -DEXPORT_AOTI_FUNCTIONS)
if(HAVE_SOVERSION)
set_target_properties(torch_cpu PROPERTIES
VERSION ${TORCH_VERSION} SOVERSION ${TORCH_SOVERSION})
@ -964,7 +963,6 @@ elseif(USE_CUDA)
set(CUDA_LINK_LIBRARIES_KEYWORD)
torch_compile_options(torch_cuda) # see cmake/public/utils.cmake
target_compile_definitions(torch_cuda PRIVATE USE_CUDA)
target_compile_definitions(torch_cuda PRIVATE -DEXPORT_AOTI_FUNCTIONS)
if(USE_CUFILE)
target_link_libraries(torch_cuda PRIVATE torch::cufile)
@ -1055,7 +1053,6 @@ if(USE_XPU)
add_library(torch_xpu ${Caffe2_XPU_SRCS})
torch_compile_options(torch_xpu) # see cmake/public/utils.cmake
target_compile_definitions(torch_xpu PRIVATE USE_XPU)
target_compile_definitions(torch_xpu PRIVATE -DEXPORT_AOTI_FUNCTIONS)
if(WIN32)
target_compile_options(torch_xpu PRIVATE /permissive-)
endif()

View File

@ -44,11 +44,8 @@
// to symbol clashes at link time if libtorch is included in a DLL and binary
// that depends on the DLL. As a short term fix, we don't export the symbols.
// In the long term, this will need to be addressed when Windows is supported.
#ifdef EXPORT_AOTI_FUNCTIONS
#define AOTI_TORCH_EXPORT __declspec(dllexport)
#else
#define AOTI_TORCH_EXPORT __declspec(dllimport)
#endif
// #define AOTI_TORCH_EXPORT __declspec(dllexport)
#define AOTI_TORCH_EXPORT
#else // !_WIN32
#define AOTI_TORCH_EXPORT
#endif // _WIN32