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

Skip to content

Conversation

@tomoaki0705
Copy link
Contributor

I see couple of warnings appear when building with Visual Studio + ARM64.
The full log is uploaded here

Mainly they are from carotene module, so it's not really important, but I'd like to suppress them.
Most of them are implicit conversion from double to float, so I made them explicitly.

  • summary
$ grep -i ' warning' log.txt  | sort | uniq -c
      1 C:\opencv\cross_build\carotene\tegra_hal.hpp(1030,1): warning C4244: 'argument': conversion from 'const double' to 'carotene_o4t::f32', possible loss of data
     48 C:\opencv\modules\core\include\opencv2\core\hal\intrin_neon.hpp(1646,12): warning C4244: 'return': conversion from 'uint64_t' to 'int', possible loss of data
      1 C:\opencv\modules\core\src\arithm.simd.hpp(1559,1): warning C4244: 'argument': conversion from 'const double' to 'carotene_o4t::f32', possible loss of data
      1 C:\opencv\modules\core\src\arithm.simd.hpp(1678,1): warning C4244: 'argument': conversion from 'const double' to 'carotene_o4t::f32', possible loss of data
      1 C:\opencv\modules\core\src\arithm.simd.hpp(1826,1): warning C4244: 'argument': conversion from 'double' to 'carotene_o4t::f32', possible loss of data
      1 C:\opencv\modules\core\src\arithm.simd.hpp(1827,1): warning C4244: 'argument': conversion from 'double' to 'carotene_o4t::f32', possible loss of data
      1 C:\opencv\modules\core\src\arithm.simd.hpp(1927,1): warning C4244: 'argument': conversion from 'const double' to 'carotene_o4t::f32', possible loss of data
      1 C:\opencv\modules\imgproc\src\resize.cpp(3784,5): warning C4244: 'argument': conversion from 'double' to 'carotene_o4t::f32', possible loss of data
  • intrin_neon.hpp
C:\opencv\modules\core\include\opencv2\core\hal\intrin_neon.hpp(1646,12): warning C4244: 'return': conversion from 'uint64_t' to 'int', possible loss of data
(compiling source file 'matmul.neon_dotprod.cpp')
  • arith.simd.hpp
C:\opencv\modules\core\src\arithm.simd.hpp(1559,1): warning C4244: 'argument': conversion from 'const double' to 'carotene_o4t::f32', possible loss of data
(compiling source file '../../../modules/core/src/arithm.dispatch.cpp')
C:\opencv\modules\core\src\arithm.simd.hpp(1678,1): warning C4244: 'argument': conversion from 'const double' to 'carotene_o4t::f32', possible loss of data
(compiling source file '../../../modules/core/src/arithm.dispatch.cpp')
C:\opencv\modules\core\src\arithm.simd.hpp(1826,1): warning C4244: 'argument': conversion from 'double' to 'carotene_o4t::f32', possible loss of data
(compiling source file '../../../modules/core/src/arithm.dispatch.cpp')
C:\opencv\modules\core\src\arithm.simd.hpp(1827,1): warning C4244: 'argument': conversion from 'double' to 'carotene_o4t::f32', possible loss of data
(compiling source file '../../../modules/core/src/arithm.dispatch.cpp')
C:\opencv\modules\core\src\arithm.simd.hpp(1927,1): warning C4244: 'argument': conversion from 'const double' to 'carotene_o4t::f32', possible loss of data
(compiling source file '../../../modules/core/src/arithm.dispatch.cpp')
  • tegra_hal.hpp
C:\opencv\cross_build\carotene\tegra_hal.hpp(1030,1): warning C4244: 'argument': conversion from 'const double' to 'carotene_o4t::f32', possible loss of data
(compiling source file '../../../modules/core/src/mathfuncs_core.dispatch.cpp')
C:\opencv\cross_build\carotene\tegra_hal.hpp(1030,1):
the template instantiation context (the oldest one first) is
	C:\opencv\modules\core\src\mathfuncs_core.dispatch.cpp(18,5):
	see reference to class template instantiation 'TegraRowOp_phase_Invoker<const carotene_o4t::f32,carotene_o4t::f32>' being compiled
	C:\opencv\cross_build\carotene\tegra_hal.hpp(1030,1):
	while compiling class template member function 'void TegraRowOp_phase_Invoker<const carotene_o4t::f32,carotene_o4t::f32>::operator ()(const cv::Range &) const'
  • resize.cpp
C:\opencv\modules\imgproc\src\resize.cpp(3784,5): warning C4244: 'argument': conversion from 'double' to 'carotene_o4t::f32', possible loss of data
(compiling source file '../../../modules/imgproc/src/resize.cpp')

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 platform: win32 platform: arm ARM boards related issues: RPi, NVIDIA TK/TX, etc labels Dec 20, 2023
@asmorkalov asmorkalov added this to the 4.10.0 milestone Dec 20, 2023
@tomoaki0705
Copy link
Contributor Author

Looks like it was too aggressive
Failed job


[----------] 1 test from Core_Mul/ElemWiseTest
[ RUN      ] Core_Mul/ElemWiseTest.accuracy/0, where GetParam() = 16-byte object <90-50 41-03 00-60 00-00 60-34 71-01 00-60 00-00>
/Users/opencv-cn/GHA-OCV-1/_work/opencv/opencv/opencv/modules/core/test/test_arithm.cpp:1505: Failure
too big relative difference (12 > 2) between 32sC2 2-dim (2 x 6409) 'dst0' and 'dst' at [0, 1].
- dst0:
-11473931, *109830701*, 47148330;
10859736, -233456661, 97400693.
- dst:
-11473931, *109830705*, 47148331;
10859737, -233456669, 97400697.


src[0] ~ 32sC2 2-dim (2 x 6409)
testCase #1

[  FAILED  ] Core_Mul/ElemWiseTest.accuracy/0, where GetParam() = 16-byte object <90-50 41-03 00-60 00-00 60-34 71-01 00-60 00-00> (1 ms)
[----------] 1 test from Core_Mul/ElemWiseTest (1 ms total)

The value looks like a small conversion error between float and double.

@tomoaki0705
Copy link
Contributor Author

This part was the cause of the test failure.
I'll leave this as-is though this causes warning on Visual Studio.

@tomoaki0705
Copy link
Contributor Author

Thank you @asmorkalov
Please confirm the latest commit a86319a aligns with your opinion or not.
If it aligns, let me squash the commits.

Copy link
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@asmorkalov asmorkalov self-assigned this Mar 3, 2024
@asmorkalov asmorkalov merged commit 2d0f928 into opencv:4.x Mar 4, 2024
@tomoaki0705 tomoaki0705 deleted the carotene_warnings branch March 4, 2024 22:13
@asmorkalov asmorkalov mentioned this pull request Mar 6, 2024
@asmorkalov asmorkalov mentioned this pull request Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: build/install platform: arm ARM boards related issues: RPi, NVIDIA TK/TX, etc platform: win32

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants