opencv-4.8.0-fix-cuda-12.2.0.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. https://github.com/opencv/opencv/pull/24104
  2. https://github.com/opencv/opencv/commit/5466fd2606ca6df57bbe43f064d2ae73fe4329eb
  3. https://bugs.gentoo.org/915775
  4. From ab8cb6f8a9034da2a289b84685c6d959266029be Mon Sep 17 00:00:00 2001
  5. From: cudawarped <12133430+cudawarped@users.noreply.github.com>
  6. Date: Tue, 1 Aug 2023 13:02:42 +0300
  7. Subject: [PATCH] cuda: fix for compatibility with CUDA Toolkit >= 12.2.0
  8. ---
  9. modules/dnn/src/cuda4dnn/primitives/normalize_bbox.hpp | 2 +-
  10. modules/dnn/src/cuda4dnn/primitives/region.hpp | 2 +-
  11. 2 files changed, 2 insertions(+), 2 deletions(-)
  12. diff --git a/modules/dnn/src/cuda4dnn/primitives/normalize_bbox.hpp b/modules/dnn/src/cuda4dnn/primitives/normalize_bbox.hpp
  13. index f067dddaa701..91ff33f81718 100644
  14. --- a/modules/dnn/src/cuda4dnn/primitives/normalize_bbox.hpp
  15. +++ b/modules/dnn/src/cuda4dnn/primitives/normalize_bbox.hpp
  16. @@ -111,7 +111,7 @@ namespace cv { namespace dnn { namespace cuda4dnn {
  17. * or there might be several weights
  18. * or we don't have to scale
  19. */
  20. - if (weight != 1.0)
  21. + if (weight != static_cast<T>(1.0f))
  22. {
  23. kernels::scale1_with_bias1<T>(stream, output, input, weight, 1.0);
  24. }
  25. diff --git a/modules/dnn/src/cuda4dnn/primitives/region.hpp b/modules/dnn/src/cuda4dnn/primitives/region.hpp
  26. index d22d44214e7b..3af05155feea 100644
  27. --- a/modules/dnn/src/cuda4dnn/primitives/region.hpp
  28. +++ b/modules/dnn/src/cuda4dnn/primitives/region.hpp
  29. @@ -121,7 +121,7 @@ namespace cv { namespace dnn { namespace cuda4dnn {
  30. new_coords
  31. );
  32. - if (nms_iou_threshold > 0) {
  33. + if (nms_iou_threshold > static_cast<T>(0.0f)) {
  34. auto output_mat = output_wrapper->getMutableHostMat();
  35. CV_Assert(output_mat.type() == CV_32F);
  36. for (int i = 0; i < input.get_axis_size(0); i++) {