Skip to content

Set C++ standard for all CUDA configurations#27142

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov:as/cuda_standard_all
Mar 26, 2025
Merged

Set C++ standard for all CUDA configurations#27142
asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov:as/cuda_standard_all

Conversation

@asmorkalov
Copy link
Copy Markdown
Contributor

Continues #27112
Addresses #27095

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

@asmorkalov asmorkalov added this to the 4.12.0 milestone Mar 25, 2025
@asmorkalov
Copy link
Copy Markdown
Contributor Author

Tested manually on Windows with CUDA 12.6.

@asmorkalov
Copy link
Copy Markdown
Contributor Author

cc @cudawarped

@asmorkalov
Copy link
Copy Markdown
Contributor Author

Cannot test Cuda 10.2 + MSVS, because Microsoft does not allow to download old Visual Studio versions.

@cudawarped
Copy link
Copy Markdown
Contributor

cudawarped commented Mar 25, 2025

@asmorkalov Working on Windows with CUDA 12.8.

Cannot test Cuda 10.2 + MSVS, because Microsoft does not allow to download old Visual Studio versions.

Installing CUDA 10.2 now to see if I can build it with my version of VS 2019.

@cudawarped
Copy link
Copy Markdown
Contributor

cudawarped commented Mar 25, 2025

@asmorkalov Building with CUDA 10.2 and VS 2019 I get the following warnings but everything builds correctly

CUSTOMBUILD : nvcc warning : The -std=c++11 flag is not supported with the configured host compiler. Flag will be ignored. [D:\build\opencv\cuda_10_2\modules\cudaarithm\opencv_cudaarithm.vcxproj]

This is probably the reason for the original condition in the CMake file.

@asmorkalov asmorkalov force-pushed the as/cuda_standard_all branch from 8ef5bf3 to 68a595d Compare March 25, 2025 13:47
@asmorkalov
Copy link
Copy Markdown
Contributor Author

@cudawarped I added OS check for CUDA pre 11.0.

@cudawarped
Copy link
Copy Markdown
Contributor

@asmorkalov That fixes the issue for everything apart from test cudev which by the looks of it would always have generated this warning

  Building NVCC (Device) object modules/cudev/test/CMakeFiles/opencv_test_cudev.dir/Debug/opencv_test_cudev_generated_test_arithm_func.cu.obj
  test_arithm_func.cu
CUSTOMBUILD : nvcc warning : The -std=c++11 flag is not supported with the configured host compiler. Flag will be ignored. [D:\build\opencv\cuda_10_2\modules\cudev\test\opencv_test_cudev.vcxproj]
CUSTOMBUILD : nvcc warning : The -std=c++11 flag is not supported with the configured host compiler. Flag will be ignored. [D:\build\opencv\cuda_10_2\modules\cudev\test\opencv_test_cudev.vcxproj]

That said with the amount of

warning : field of class type without a DLL interface used in a class with a DLL interface

warnings generated by VS 2019 with CUDA 10.2 I am not sure if this is an issue worth fixing.

@asmorkalov asmorkalov changed the title WIP: Set C++ standard for all CUDA configurations. Set C++ standard for all CUDA configurations Mar 26, 2025
@asmorkalov asmorkalov self-assigned this Mar 26, 2025
@asmorkalov
Copy link
Copy Markdown
Contributor Author

@cudawarped Thanks a lot for the investigation. I merge the patch then and return back to cudev later.

@asmorkalov asmorkalov merged commit 8e2826d into opencv:4.x Mar 26, 2025
28 checks passed
@asmorkalov asmorkalov mentioned this pull request Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants