8000 Revert "export AOTI_TORCH_EXPORT on Windows. (#140030)" · pytorch/pytorch@90fc2b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 90fc2b4

Browse files
Revert "export AOTI_TORCH_EXPORT on Windows. (#140030)"
This reverts commit 82544bd. Reverted #140030 on behalf of https://github.com/clee2000 due to still has failures internally when building, D66923759 ([comment](#140030 (comment)))
1 parent dd5df00 commit 90fc2b4

File tree

4 files changed

+2
-12
lines changed
  • torch
  • 4 files changed

    +2
    -12
    lines changed

    CMakeLists.txt

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1097,9 +1097,6 @@ if(NOT MSVC)
    10971097
    append_cxx_flag_if_supported("-Wno-error=redundant-move" CMAKE_CXX_FLAGS)
    10981098
    endif()
    10991099
    else()
    1100-
    # Define export functions for AOTI.
    1101-
    add_compile_definitions(EXPORT_AOTI_FUNCTIONS)
    1102-
    11031100
    # skip unwanted includes from windows.h
    11041101
    add_compile_definitions(WIN32_LEAN_AND_MEAN)
    11051102
    # Windows SDK broke compatibility since version 25131, but introduced this

    caffe2/CMakeLists.txt

    Lines changed: 0 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -779,7 +779,6 @@ endif()
    779779

    780780
    if(NOT BUILD_LIBTORCHLESS)
    781781
    add_library(torch_cpu ${Caffe2_CPU_SRCS})
    782-
    # target_compile_definitions(torch_cpu PRIVATE -DEXPORT_AOTI_FUNCTIONS)
    783782
    if(HAVE_SOVERSION)
    784783
    set_target_properties(torch_cpu PROPERTIES
    785784
    VERSION ${TORCH_VERSION} SOVERSION ${TORCH_SOVERSION})
    @@ -964,7 +963,6 @@ elseif(USE_CUDA)
    964963
    set(CUDA_LINK_LIBRARIES_KEYWORD)
    965964
    torch_compile_options(torch_cuda) # see cmake/public/utils.cmake
    966965
    target_compile_definitions(torch_cuda PRIVATE USE_CUDA)
    967-
    # target_compile_definitions(torch_cuda PRIVATE -DEXPORT_AOTI_FUNCTIONS)
    968966

    969967
    if(USE_CUFILE)
    970968
    target_link_libraries(torch_cuda PRIVATE torch::cufile)
    @@ -1056,7 +1054,6 @@ if(USE_XPU)
    10561054
    add_library(torch_xpu ${Caffe2_XPU_SRCS})
    10571055
    torch_compile_options(torch_xpu) # see cmake/public/utils.cmake
    10581056
    target_compile_definitions(torch_xpu PRIVATE USE_XPU)
    1059-
    # target_compile_definitions(torch_xpu PRIVATE -DEXPORT_AOTI_FUNCTIONS)
    10601057
    if(WIN32)
    10611058
    target_compile_options(torch_xpu PRIVATE /permissive-)
    10621059
    endif()

    torch/CMakeLists.txt

    Lines changed: 0 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -310,7 +310,6 @@ endif()
    310310

    311311
    add_library(torch_python SHARED ${TORCH_PYTHON_SRCS})
    312312
    torch_compile_options(torch_python) # see cmake/public/utils.cmake
    313-
    # target_compile_definitions(torch_python PRIVATE -DEXPORT_AOTI_FUNCTIONS)
    314313
    if(NOT WIN32)
    315314
    target_compile_options(torch_python PRIVATE
    316315
    $<$<COMPILE_LANGUAGE:CXX>: -fvisibility=default>)

    torch/csrc/inductor/aoti_torch/c/shim.h

    Lines changed: 2 additions & 5 deletions
    Original file line numberDiff line numberDiff line change
    @@ -44,11 +44,8 @@
    4444
    // to symbol clashes at link time if libtorch is included in a DLL and binary
    4545
    // that depends on the DLL. As a short term fix, we don't export the symbols.
    4646
    // In the long term, this will need to be addressed when Windows is supported.
    47-
    #ifdef EXPORT_AOTI_FUNCTIONS
    48-
    #define AOTI_TORCH_EXPORT __declspec(dllexport)
    49-
    #else
    50-
    #define AOTI_TORCH_EXPORT __declspec(dllimport)
    51-
    #endif
    47+
    // #define AOTI_TORCH_EXPORT __declspec(dllexport)
    48+
    #define AOTI_TORCH_EXPORT
    5249
    #else // !_WIN32
    5350
    #define AOTI_TORCH_EXPORT
    5451
    #endif // _WIN32

    0 commit comments

    Comments
     (0)
    0