Revert "Remove THC from OSS build (#134969)"

This reverts commit 9c7660be0ee155baf0cb7e1e67708dd784ac5796.

Reverted https://github.com/pytorch/pytorch/pull/134969 on behalf of https://github.com/huydhn due to Sorry for reverting your change but it is breaking the installation of https://github.com/facebookresearch/detectron2/blob/main/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.cu#L76 ([comment](https://github.com/pytorch/pytorch/pull/134969#issuecomment-2499275378))
This commit is contained in:
PyTorch MergeBot
2024-11-26 00:00:12 +00:00
parent f1451163ec
commit 964655bf0c
3 changed files with 11 additions and 0 deletions

View File

@ -301,6 +301,7 @@ cc_library(
"aten/src/**/*.hpp",
"aten/src/ATen/cuda/**/*.cuh",
"aten/src/ATen/native/**/*.cuh",
"aten/src/THC/*.cuh",
],
) + [
":aten_src_ATen_config",

View File

@ -79,9 +79,11 @@ if(USE_ROCM)
# TODO: AT_HIP_ENABLED (change this once we represent HIP as HIP in
# ATen proper)
set(AT_CUDA_ENABLED 1)
add_subdirectory(src/THH)
message("ROCm is enabled.")
elseif(USE_CUDA)
set(AT_CUDA_ENABLED 1)
add_subdirectory(src/THC)
else()
message("disabling CUDA because USE_CUDA is set false")
set(AT_CUDA_ENABLED 0)

View File

@ -0,0 +1,8 @@
set(ATen_CUDA_INCLUDE ${ATen_CUDA_INCLUDE}
"${CMAKE_CURRENT_SOURCE_DIR}"
PARENT_SCOPE)
install(FILES
THCAtomics.cuh
THCDeviceUtils.cuh
DESTINATION "${ATEN_INSTALL_INCLUDE_SUBDIR}/THC")