Skip to content

cuda: CMake add CUDA first class language support#3400

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
cudawarped:add_cuda_first_class_support
Dec 26, 2023
Merged

cuda: CMake add CUDA first class language support#3400
asmorkalov merged 1 commit intoopencv:4.xfrom
cudawarped:add_cuda_first_class_support

Conversation

@cudawarped
Copy link
Copy Markdown
Contributor

@cudawarped cudawarped commented Dec 23, 2022

This PR adds CUDA first class language support which has been avaliable since CMake 3.8. Currently OpenCV uses the depreciated (since CMake 3.10) FindCUDA module.

This new feature is added automatically when OpenCV is built against CMake >= 3.18 (when the FindCUDAToolkit results variable CUDAToolkit_LIBRARY_ROOT was added). It can be disabled by passing -DENABLE_CUDA_FIRST_CLASS_LANGUAGE=OFF to CMake.

All projects which use OpenCV targets built with -DENABLE_CUDA_FIRST_CLASS_LANGUAGE=ON need to use CMake >=3.18 due to the new imported targets provided by FindCUDAToolkit.

Fixes opencv/opencv#23422, fixes opencv/opencv#23659, fixes opencv/opencv#24034, fixes opencv/opencv#24177, fixes opencv/opencv#24195, fixes #3143, fixes #3414

Dependent on opencv/opencv#23021.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment