mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
update docs
minor fixes and refactoring of GPU module
This commit is contained in:
@@ -384,7 +384,7 @@ void CV_GpuBruteForceMatcherTest::knnMatchTest( const GpuMat& query, const GpuMa
|
||||
|
||||
void CV_GpuBruteForceMatcherTest::radiusMatchTest( const GpuMat& query, const GpuMat& train )
|
||||
{
|
||||
bool atomics_ok = TargetArchs::builtWith(ATOMICS) && DeviceInfo().supports(ATOMICS);
|
||||
bool atomics_ok = TargetArchs::builtWith(GLOBAL_ATOMICS) && DeviceInfo().supports(GLOBAL_ATOMICS);
|
||||
if (!atomics_ok)
|
||||
{
|
||||
ts->printf(CvTS::CONSOLE, "\nCode and device atomics support is required for radiusMatch (CC >= 1.1)");
|
||||
|
||||
@@ -53,7 +53,7 @@ struct CV_GpuMeanShiftTest : public CvTest
|
||||
|
||||
void run(int)
|
||||
{
|
||||
bool cc12_ok = TargetArchs::builtWith(COMPUTE_12) && DeviceInfo().supports(COMPUTE_12);
|
||||
bool cc12_ok = TargetArchs::builtWith(FEATURE_SET_COMPUTE_12) && DeviceInfo().supports(FEATURE_SET_COMPUTE_12);
|
||||
if (!cc12_ok)
|
||||
{
|
||||
ts->printf(CvTS::CONSOLE, "\nCompute capability 1.2 is required");
|
||||
@@ -67,8 +67,8 @@ struct CV_GpuMeanShiftTest : public CvTest
|
||||
cv::Mat img = cv::imread(std::string(ts->get_data_path()) + "meanshift/cones.png");
|
||||
cv::Mat img_template;
|
||||
|
||||
if (cv::gpu::TargetArchs::builtWith(cv::gpu::COMPUTE_20) &&
|
||||
cv::gpu::DeviceInfo().supports(cv::gpu::COMPUTE_20))
|
||||
if (cv::gpu::TargetArchs::builtWith(cv::gpu::FEATURE_SET_COMPUTE_20) &&
|
||||
cv::gpu::DeviceInfo().supports(cv::gpu::FEATURE_SET_COMPUTE_20))
|
||||
img_template = cv::imread(std::string(ts->get_data_path()) + "meanshift/con_result.png");
|
||||
else
|
||||
img_template = cv::imread(std::string(ts->get_data_path()) + "meanshift/con_result_CC1X.png");
|
||||
@@ -145,7 +145,7 @@ struct CV_GpuMeanShiftProcTest : public CvTest
|
||||
|
||||
void run(int)
|
||||
{
|
||||
bool cc12_ok = TargetArchs::builtWith(COMPUTE_12) && DeviceInfo().supports(COMPUTE_12);
|
||||
bool cc12_ok = TargetArchs::builtWith(FEATURE_SET_COMPUTE_12) && DeviceInfo().supports(FEATURE_SET_COMPUTE_12);
|
||||
if (!cc12_ok)
|
||||
{
|
||||
ts->printf(CvTS::CONSOLE, "\nCompute capability 1.2 is required");
|
||||
@@ -219,8 +219,8 @@ struct CV_GpuMeanShiftProcTest : public CvTest
|
||||
cv::Mat spmap_template;
|
||||
cv::FileStorage fs;
|
||||
|
||||
if (cv::gpu::TargetArchs::builtWith(cv::gpu::COMPUTE_20) &&
|
||||
cv::gpu::DeviceInfo().supports(cv::gpu::COMPUTE_20))
|
||||
if (cv::gpu::TargetArchs::builtWith(cv::gpu::FEATURE_SET_COMPUTE_20) &&
|
||||
cv::gpu::DeviceInfo().supports(cv::gpu::FEATURE_SET_COMPUTE_20))
|
||||
fs.open(std::string(ts->get_data_path()) + "meanshift/spmap.yaml", cv::FileStorage::READ);
|
||||
else
|
||||
fs.open(std::string(ts->get_data_path()) + "meanshift/spmap_CC1X.yaml", cv::FileStorage::READ);
|
||||
|
||||
@@ -54,7 +54,7 @@ struct CV_GpuMeanShiftSegmentationTest : public CvTest {
|
||||
{
|
||||
try
|
||||
{
|
||||
bool cc12_ok = TargetArchs::builtWith(COMPUTE_12) && DeviceInfo().supports(COMPUTE_12);
|
||||
bool cc12_ok = TargetArchs::builtWith(FEATURE_SET_COMPUTE_12) && DeviceInfo().supports(FEATURE_SET_COMPUTE_12);
|
||||
if (!cc12_ok)
|
||||
{
|
||||
ts->printf(CvTS::CONSOLE, "\nCompute capability 1.2 is required");
|
||||
@@ -77,7 +77,7 @@ struct CV_GpuMeanShiftSegmentationTest : public CvTest {
|
||||
{
|
||||
stringstream path;
|
||||
path << ts->get_data_path() << "meanshift/cones_segmented_sp10_sr10_minsize" << minsize;
|
||||
if (TargetArchs::builtWith(COMPUTE_20) && DeviceInfo().supports(COMPUTE_20))
|
||||
if (TargetArchs::builtWith(FEATURE_SET_COMPUTE_20) && DeviceInfo().supports(FEATURE_SET_COMPUTE_20))
|
||||
path << ".png";
|
||||
else
|
||||
path << "_CC1X.png";
|
||||
|
||||
@@ -66,21 +66,24 @@ void CV_GpuMatOpConvertToTest::run(int /* start_from */)
|
||||
{
|
||||
const Size img_size(67, 35);
|
||||
|
||||
const int types[] = {CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F};
|
||||
const int types_num = sizeof(types) / sizeof(int);
|
||||
const char* types_str[] = {"CV_8U", "CV_8S", "CV_16U", "CV_16S", "CV_32S", "CV_32F", "CV_64F"};
|
||||
|
||||
bool passed = true;
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < types_num && passed; ++i)
|
||||
int lastType = CV_32F;
|
||||
|
||||
if (TargetArchs::builtWith(NATIVE_DOUBLE) && DeviceInfo().supports(NATIVE_DOUBLE))
|
||||
lastType = CV_64F;
|
||||
|
||||
for (int i = 0; i <= lastType && passed; ++i)
|
||||
{
|
||||
for (int j = 0; j < types_num && passed; ++j)
|
||||
for (int j = 0; j <= lastType && passed; ++j)
|
||||
{
|
||||
for (int c = 1; c < 5 && passed; ++c)
|
||||
{
|
||||
const int src_type = CV_MAKETYPE(types[i], c);
|
||||
const int dst_type = types[j];
|
||||
const int src_type = CV_MAKETYPE(i, c);
|
||||
const int dst_type = j;
|
||||
|
||||
cv::RNG rng(*ts->get_rng());
|
||||
|
||||
|
||||
@@ -126,7 +126,12 @@ void CV_GpuMatOpCopyToTest::run( int /* start_from */)
|
||||
|
||||
try
|
||||
{
|
||||
for (int i = 0 ; i < 7; i++)
|
||||
int lastType = CV_32F;
|
||||
|
||||
if (TargetArchs::builtWith(NATIVE_DOUBLE) && DeviceInfo().supports(NATIVE_DOUBLE))
|
||||
lastType = CV_64F;
|
||||
|
||||
for (int i = 0 ; i <= lastType; i++)
|
||||
{
|
||||
Mat cpumat(rows, cols, i);
|
||||
cpumat.setTo(Scalar::all(127));
|
||||
|
||||
@@ -101,7 +101,12 @@ void CV_GpuMatOpSetToTest::run( int /* start_from */)
|
||||
rng.fill(cpumask, RNG::UNIFORM, cv::Scalar::all(0.0), cv::Scalar(1.5));
|
||||
cv::gpu::GpuMat gpumask(cpumask);
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
int lastType = CV_32F;
|
||||
|
||||
if (TargetArchs::builtWith(NATIVE_DOUBLE) && DeviceInfo().supports(NATIVE_DOUBLE))
|
||||
lastType = CV_64F;
|
||||
|
||||
for (int i = 0; i <= lastType; i++)
|
||||
{
|
||||
for (int cn = 1; cn <= 4; ++cn)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user