Skip to content

CUDA: CUDA_Arithm/PolarToCart test sometime fails with slight eps over #17942

@tomoaki0705

Description

@tomoaki0705
System information (version)
  • OpenCV => recent 3.4 ( 5bfa43f ) / master ( b698d0a ) + contrib master ( bdc0101 )
  • Operating System / Platform => Ubuntu 16.04/18.04 Jetson TX1, TX2, Xavier, Nano
  • Compiler => GCC5.4.0. 7.5.0
Detailed description

Here's the log of test failure

[----------] 16 tests from CUDA_Arithm/PolarToCart
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/0, where GetParam() = (NVIDIA Tegra X1, 128x128, 32FC1, AngleInDegrees(false), whole matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/0 (4 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/1, where GetParam() = (NVIDIA Tegra X1, 128x128, 32FC1, AngleInDegrees(false), sub matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/1 (3 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/2, where GetParam() = (NVIDIA Tegra X1, 128x128, 32FC1, AngleInDegrees(true), whole matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/2 (3 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/3, where GetParam() = (NVIDIA Tegra X1, 128x128, 32FC1, AngleInDegrees(true), sub matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/3 (5 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/4, where GetParam() = (NVIDIA Tegra X1, 128x128, 64FC1, AngleInDegrees(false), whole matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/4 (6 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/5, where GetParam() = (NVIDIA Tegra X1, 128x128, 64FC1, AngleInDegrees(false), sub matrix)
/home/nvidia/opencv-fork/modules/cudaarithm/test/test_element_operations.cpp:2792: Failure
The max difference between matrices "y_gold" and "y" is 0.00191286 at (81, 25), which exceeds "tol", where "y_gold" at (81, 25) evaluates to (29.4421), "y" at (81, 25) evaluates to (29.4402), "tol" evaluates to 0.0019
[  FAILED  ] CUDA_Arithm/PolarToCart.Accuracy/5, where GetParam() = (NVIDIA Tegra X1, 128x128, 64FC1, AngleInDegrees(false), sub matrix) (5 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/6, where GetParam() = (NVIDIA Tegra X1, 128x128, 64FC1, AngleInDegrees(true), whole matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/6 (5 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/7, where GetParam() = (NVIDIA Tegra X1, 128x128, 64FC1, AngleInDegrees(true), sub matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/7 (5 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/8, where GetParam() = (NVIDIA Tegra X1, 113x113, 32FC1, AngleInDegrees(false), whole matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/8 (3 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/9, where GetParam() = (NVIDIA Tegra X1, 113x113, 32FC1, AngleInDegrees(false), sub matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/9 (3 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/10, where GetParam() = (NVIDIA Tegra X1, 113x113, 32FC1, AngleInDegrees(true), whole matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/10 (4 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/11, where GetParam() = (NVIDIA Tegra X1, 113x113, 32FC1, AngleInDegrees(true), sub matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/11 (3 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/12, where GetParam() = (NVIDIA Tegra X1, 113x113, 64FC1, AngleInDegrees(false), whole matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/12 (4 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/13, where GetParam() = (NVIDIA Tegra X1, 113x113, 64FC1, AngleInDegrees(false), sub matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/13 (4 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/14, where GetParam() = (NVIDIA Tegra X1, 113x113, 64FC1, AngleInDegrees(true), whole matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/14 (5 ms)
[ RUN      ] CUDA_Arithm/PolarToCart.Accuracy/15, where GetParam() = (NVIDIA Tegra X1, 113x113, 64FC1, AngleInDegrees(true), sub matrix)
[       OK ] CUDA_Arithm/PolarToCart.Accuracy/15 (4 ms)
[----------] 16 tests from CUDA_Arithm/PolarToCart (66 ms total)

The point is that input is based on random value, and in some corner case, the difference becomes much larger than the hard coded value.
I ran through 32768 iterations of the test, and this max difference I could confirm was 0.00194626. I'll send a PR shortly

Steps to reproduce
$ mkdir build
$ cd build
$ cmake -DOPENCV_EXTRA_MODULES_PATH=/path/to/opencv_contrib/modules -DBUILD_EXAMPLES=true -DOPENCV_ENABLE_NONFREE=true -DWITH_CUDA=ON ..
$ ./bin/opencv_test_cudaarithm 
Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions