Use official CUDAToolkit module in CMake (#154595)

Use CUDA language in CMake and remove forked FindCUDAToolkit.cmake.
Some CUDA targets are also renamed with `torch::` prefix.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/154595
Approved by: https://github.com/albanD
This commit is contained in:
cyy
2025-06-22 05:44:29 +00:00
committed by PyTorch MergeBot
parent 1d993fa309
commit 08dae945ae
25 changed files with 194 additions and 4584 deletions

View File

@ -50,7 +50,7 @@ if(USE_CUDA)
if(NOT CAFFE2_USE_NVRTC)
caffe2_update_option(USE_NVRTC OFF)
endif()
list(APPEND Caffe2_CUDA_DEPENDENCY_LIBS caffe2::curand caffe2::cufft caffe2::cublas)
list(APPEND Caffe2_CUDA_DEPENDENCY_LIBS torch::curand torch::cufft torch::cublas)
if(CAFFE2_USE_CUDNN)
list(APPEND Caffe2_CUDA_DEPENDENCY_LIBS torch::cudnn)
else()