Files
pytorch/cmake/Modules/FindCUB.cmake
Nikita Shulga c373387709 Update CMake and use native CUDA language support (#62445)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62445

PyTorch currently uses the old style of compiling CUDA in CMake which is just a
bunch of scripts in `FindCUDA.cmake`. Newer versions support CUDA natively as
a language just like C++ or C.

Test Plan: Imported from OSS

Reviewed By: ejguan

Differential Revision: D31503350

fbshipit-source-id: 2ee817edc9698531ae1b87eda3ad271ee459fd55
2021-10-11 09:05:48 -07:00

20 lines
494 B
CMake

# Try to find the CUB library and headers.
# CUB_FOUND - system has CUB
# CUB_INCLUDE_DIRS - the CUB include directory
find_path(CUB_INCLUDE_DIR
HINTS "${CUDA_TOOLKIT_INCLUDE}"
NAMES cub/cub.cuh
DOC "The directory where CUB includes reside"
)
set(CUB_INCLUDE_DIRS ${CUB_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CUB
FOUND_VAR CUB_FOUND
REQUIRED_VARS CUB_INCLUDE_DIR
)
mark_as_advanced(CUB_FOUND)