mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Export XPU libs to be public (#136974)
# Motivation Export XPU-related libs to be public. Now they are included in `TORCH_LIBRARIES` Pull Request resolved: https://github.com/pytorch/pytorch/pull/136974 Approved by: https://github.com/EikanWang, https://github.com/malfet
This commit is contained in:
committed by
PyTorch MergeBot
parent
80f3ee41dc
commit
2c94c54f10
@ -75,6 +75,9 @@ else()
|
||||
if(@USE_CUDA@)
|
||||
append_wholearchive_lib_if_found(torch_cuda c10_cuda)
|
||||
endif()
|
||||
if(@USE_XPU@)
|
||||
append_wholearchive_lib_if_found(torch_xpu c10_xpu)
|
||||
endif()
|
||||
|
||||
# We need manually add dependent libraries when they are not linked into the
|
||||
# shared library.
|
||||
@ -138,6 +141,10 @@ if(@USE_CUDA@)
|
||||
list(APPEND TORCH_LIBRARIES ${TORCH_CUDA_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(@USE_XPU@ AND @BUILD_SHARED_LIBS@)
|
||||
append_torchlib_if_found(c10_xpu torch_xpu)
|
||||
endif()
|
||||
|
||||
# When we build libtorch with the old libstdc++ ABI, dependent libraries must too.
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(TORCH_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=@GLIBCXX_USE_CXX11_ABI@")
|
||||
|
Reference in New Issue
Block a user