Skip to content

CMakeLists.txt defines USER_DEFINED_CMAKE_CUDA_ARCHITECTURES but the variable isn't used anywhere #27076

@patrikhuber

Description

@patrikhuber

System Information

Latest OpenCV 4.x main as of today

Detailed description

The main CMakeLists.txt defines USER_DEFINED_CMAKE_CUDA_ARCHITECTURES here:

if(CMAKE_CUDA_ARCHITECTURES)

However this variable isn't used anywhere else in any CMake script, it seems:

opencv$ grep -R --include='*[cC][mM][aA][kK][eE]*' --exclude-dir={build,install} "USER_DEFINED_CMAKE_CUDA_ARCHITECTURES" .
./CMakeLists.txt:        set(USER_DEFINED_CMAKE_CUDA_ARCHITECTURES TRUE)
./CMakeLists.txt:      if(NOT USER_DEFINED_CMAKE_CUDA_ARCHITECTURES)

Perhaps this is an artefact from the past?

It seems this code could be simplified to the following, since this is all it seems to be doing:

      if(NOT CMAKE_CUDA_ARCHITECTURES)
        set(CMAKE_CUDA_ARCHITECTURES "")
      endif()
      enable_language(CUDA)

And that feels a bit pointless?

Steps to reproduce

See above.

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions