mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[ROCm] Load ROCm if Torch is used as a dependency (#80469)
Includes LoadHIP.cmake if pytorch is used as a dependency for another project and ROCm is enabled. This removes the need to explicitly link against ROCm libraries in extension projects. Pull Request resolved: https://github.com/pytorch/pytorch/pull/80469 Approved by: https://github.com/pruthvistony, https://github.com/malfet
This commit is contained in:
committed by
PyTorch MergeBot
parent
6bf4c662c8
commit
d03f989d53
@ -1095,6 +1095,7 @@ if(BUILD_SHARED_LIBS)
|
||||
${PROJECT_SOURCE_DIR}/cmake/public/protobuf.cmake
|
||||
${PROJECT_SOURCE_DIR}/cmake/public/threads.cmake
|
||||
${PROJECT_SOURCE_DIR}/cmake/public/utils.cmake
|
||||
${PROJECT_SOURCE_DIR}/cmake/public/LoadHIP.cmake
|
||||
DESTINATION share/cmake/Caffe2/public
|
||||
COMPONENT dev)
|
||||
install(DIRECTORY
|
||||
|
@ -78,6 +78,10 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (@USE_ROCM@)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/public/LoadHIP.cmake")
|
||||
endif()
|
||||
|
||||
if(@USE_CUDA@)
|
||||
# The file public/cuda.cmake exclusively uses CAFFE2_USE_*.
|
||||
# If Caffe2 was compiled with the libraries below, they must
|
||||
|
Reference in New Issue
Block a user