[opencv] 44/251: core(test): fix input data for OCL FP16 test

Nobuhiro Iwamatsu iwamatsu at moszumanska.debian.org
Sun Aug 27 23:27:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

iwamatsu pushed a commit to annotated tag 3.3.0
in repository opencv.

commit d6c5e18e240f9c3dc0d71fa84400e5faa9b7267a
Author: Alexander Alekhin <alexander.alekhin at intel.com>
Date:   Wed Jul 12 18:51:11 2017 +0300

    core(test): fix input data for OCL FP16 test
---
 modules/core/test/ocl/test_arithm.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/core/test/ocl/test_arithm.cpp b/modules/core/test/ocl/test_arithm.cpp
index 1164473..7425c17 100644
--- a/modules/core/test/ocl/test_arithm.cpp
+++ b/modules/core/test/ocl/test_arithm.cpp
@@ -1639,6 +1639,14 @@ PARAM_TEST_CASE(ConvertFp16, Channels, bool)
         Size roiSize = randomSize(1, MAX_VALUE);
         Border srcBorder = randomBorder(0, 0);
         randomSubMat(src, src_roi, roiSize, srcBorder, stype, -11, 11); // FIXIT: Test with minV, maxV
+        if (stype == CV_MAKE_TYPE(CV_16S, cn)) // eliminate NaN/Inf FP16 values
+        {
+            RNG dataRng(rng.next());
+            Mat src_i32 = cvtest::randomMat(dataRng, roiSize, CV_MAKE_TYPE(CV_32S, cn), 0, 0x7c00, false);
+            Mat shift_i32 = cvtest::randomMat(dataRng, roiSize, src_i32.type(), -1, 1, false); // values: -1, 0
+            src_i32 = src_i32 + (shift_i32 * 0x8000);
+            src_i32.convertTo(src_roi, stype);
+        }
 
         Border dstBorder = randomBorder(0, 0);
         randomSubMat(dst, dst_roi, roiSize, dstBorder, dtype, 5, 16);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git



More information about the debian-science-commits mailing list