Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

tomoaki0705
Copy link
Contributor

Pull Request Readiness Checklist

When building with GCC 7.5, I see following warning message.

In file included from /opencv-fork/modules/core/include/opencv2/core.hpp:53:0,
                 from /opencv-fork/modules/dnn/src/layers/../precomp.hpp:49,
                 from /opencv-fork/modules/dnn/src/layers/fully_connected_layer.cpp:43:
/opencv-fork/modules/dnn/src/layers/../cuda4dnn/primitives/matmul.hpp: In instantiation of β€˜void cv::dnn::cuda4dnn::MatMulOp<T>::forward(const std::vector<cv::Ptr<cv::dnn::dnn4_v20221220::BackendWrapper> >&, const std::vector<cv::Ptr<cv::dnn::dnn4_v20221220::BackendWrapper> >&, cv::dnn::cuda4dnn::csl::Workspace&) [with T = float]’:
/opencv-fork/modules/dnn/src/layers/fully_connected_layer.cpp:871:1:   required from here
/opencv-fork/modules/dnn/src/layers/../cuda4dnn/primitives/matmul.hpp:41:43: warning: suggest parentheses around β€˜&&’ within β€˜||’ [-Wparentheses]
             CV_Assert((inputs.size() == 2 && constTensor.empty() ||
/opencv-fork/modules/core/include/opencv2/core/base.hpp:342:38: note: in definition of macro β€˜CV_Assert’
 #define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
                                      ^~~~
/opencv-fork/modules/dnn/src/layers/../cuda4dnn/primitives/matmul.hpp: In instantiation of β€˜void cv::dnn::cuda4dnn::MatMulOp<T>::forward(const std::vector<cv::Ptr<cv::dnn::dnn4_v20221220::BackendWrapper> >&, const std::vector<cv::Ptr<cv::dnn::dnn4_v20221220::BackendWrapper> >&, cv::dnn::cuda4dnn::csl::Workspace&) [with T = __half]’:
/opencv-fork/modules/dnn/src/layers/fully_connected_layer.cpp:871:1:   required from here
/opencv-fork/modules/dnn/src/layers/../cuda4dnn/primitives/matmul.hpp:41:43: warning: suggest parentheses around β€˜&&’ within β€˜||’ [-Wparentheses]
             CV_Assert((inputs.size() == 2 && constTensor.empty() ||
/opencv-fork/modules/core/include/opencv2/core/base.hpp:342:38: note: in definition of macro β€˜CV_Assert’
 #define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
                                      ^~~~

It's not really important, but I think it's worth fixing this warning.
This line happens from 4.x branch, so starting from here.

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

@tomoaki0705
Copy link
Contributor Author

Confirmed in following configuration
Jetson Nano GCC 7.5, CUDA 10.0, CuDNN 8.2.1
Jetson Xavier GCC 7.5, CUDA 10.2, CuDNN 8.2.1

@opencv-pushbot opencv-pushbot merged commit 8ffc06f into opencv:4.x Jan 23, 2023
@tomoaki0705 tomoaki0705 deleted the fix_warning_master branch January 23, 2023 18:55
@alalek alalek mentioned this pull request Jan 28, 2023
@asmorkalov asmorkalov mentioned this pull request May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants