Test code - GpuMatND & Mat interoperability#2805
Test code - GpuMatND & Mat interoperability#2805opencv-pushbot merged 1 commit intoopencv:masterfrom
Conversation
c189b7d to
842d756
Compare
|
BTW, Please avoid using of |
74127fb to
60319b3
Compare
modules/cudev/test/test_nd.cu
Outdated
| { | ||
| // simple upload, download test for GpuMatND | ||
|
|
||
| gmat.upload(gold); | ||
| gmat.download(dst); | ||
|
|
||
| EXPECT_TRUE(std::equal(gold.begin(), gold.end(), dst.begin())); | ||
| } |
There was a problem hiding this comment.
It'll be great if you split the blocks like this on dedicated parameterized tests with GTest. It simplifies issue triaging and reduces side effects if one block affects another during execution. The test you used as base was implemented in prehistoric period and we try to get rid of large 'doTest' things that does everything.
There was a problem hiding this comment.
Okay, I'll split the blocks in the next commit.
Currently, it uses type-parameterized tests. Should I change it to a value parameterized form?
| @@ -0,0 +1,247 @@ | |||
| #include "test_precomp.hpp" | |||
There was a problem hiding this comment.
Please use short license header: https://github.com/opencv/opencv/wiki/Coding_Style_Guide#file-structure
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
modules/cudev/test/test_nd.cu
Outdated
|
|
||
| using namespace cv; | ||
| using namespace cv::cuda; | ||
| using namespace cvtest; |
There was a problem hiding this comment.
Please use namespace opencv_test { namespace { like others tests do.
modules/cudev/test/test_nd.cu
Outdated
| for (ElemType& elem : ret) | ||
| for (int i = 0; i < cn; ++i) | ||
| elem[i] = static_cast<CnType>(std::rand()); |
There was a problem hiding this comment.
I have fixed test codes but builds failed because of a merge conflict.
Main PR: opencv/opencv#19259