Skip to content

Commit

Permalink
[opencv4] Fix cuDNN feature for CUDA 12.2 (microsoft#33898)
Browse files Browse the repository at this point in the history
* Add patch for CUDA 12.2 from upstream

opencv/opencv#24104

* Update version database
  • Loading branch information
pskopnik authored Sep 26, 2023
1 parent f1dec55 commit 70fd7df
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 2 deletions.
32 changes: 32 additions & 0 deletions ports/opencv4/0020-fix-compat-cuda12.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
commit ab8cb6f8a9034da2a289b84685c6d959266029be
Author: cudawarped <[email protected]>
Date: Tue Aug 1 13:02:42 2023 +0300

cuda: fix for compatibility with CUDA Toolkit >= 12.2.0

diff --git a/modules/dnn/src/cuda4dnn/primitives/normalize_bbox.hpp b/modules/dnn/src/cuda4dnn/primitives/normalize_bbox.hpp
index f067dddaa7..91ff33f817 100644
--- a/modules/dnn/src/cuda4dnn/primitives/normalize_bbox.hpp
+++ b/modules/dnn/src/cuda4dnn/primitives/normalize_bbox.hpp
@@ -111,7 +111,7 @@ namespace cv { namespace dnn { namespace cuda4dnn {
* or there might be several weights
* or we don't have to scale
*/
- if (weight != 1.0)
+ if (weight != static_cast<T>(1.0f))
{
kernels::scale1_with_bias1<T>(stream, output, input, weight, 1.0);
}
diff --git a/modules/dnn/src/cuda4dnn/primitives/region.hpp b/modules/dnn/src/cuda4dnn/primitives/region.hpp
index d22d44214e..3af05155fe 100644
--- a/modules/dnn/src/cuda4dnn/primitives/region.hpp
+++ b/modules/dnn/src/cuda4dnn/primitives/region.hpp
@@ -121,7 +121,7 @@ namespace cv { namespace dnn { namespace cuda4dnn {
new_coords
);

- if (nms_iou_threshold > 0) {
+ if (nms_iou_threshold > static_cast<T>(0.0f)) {
auto output_mat = output_wrapper->getMutableHostMat();
CV_Assert(output_mat.type() == CV_32F);
for (int i = 0; i < input.get_axis_size(0); i++) {
1 change: 1 addition & 0 deletions ports/opencv4/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ vcpkg_from_github(
0015-fix-freetype.patch
0017-fix-flatbuffers.patch
0019-missing-include.patch
0020-fix-compat-cuda12.2.patch
"${ARM64_WINDOWS_FIX}"
)
# Disallow accidental build of vendored copies
Expand Down
2 changes: 1 addition & 1 deletion ports/opencv4/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "opencv4",
"version": "4.8.0",
"port-version": 6,
"port-version": 7,
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6074,7 +6074,7 @@
},
"opencv4": {
"baseline": "4.8.0",
"port-version": 6
"port-version": 7
},
"opendnp3": {
"baseline": "3.1.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/opencv4.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ef78c1958b122045e9d1e353150049431b3162fa",
"version": "4.8.0",
"port-version": 7
},
{
"git-tree": "6a1280a0a3854032ba4ae9172b509ce46f81795f",
"version": "4.8.0",
Expand Down

0 comments on commit 70fd7df

Please sign in to comment.