-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test code - GpuMatND & Mat interoperability #2805
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed it.
@@ -0,0 +1,247 @@ | |||
#include "test_precomp.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cv::randu()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed test codes but builds failed because of a merge conflict.
Main PR: opencv/opencv#19259