diff --git a/modules/gpu/perf/main.cpp b/modules/gpu/perf/main.cpp index 865362f88..aadeee955 100644 --- a/modules/gpu/perf/main.cpp +++ b/modules/gpu/perf/main.cpp @@ -71,9 +71,9 @@ void printCudaInfo() #endif } -int main(int argc, char **argv) +int main(int argc, char** argv) { - CommandLineParser cmd(argc, argv, + CommandLineParser cmd(argc, (const char**) argv, "{ print_info_only | print_info_only | false | Print information about system and exit }" "{ device | device | 0 | Device on which tests will be executed }" "{ cpu | cpu | false | Run tests on cpu }" @@ -119,7 +119,7 @@ int main(int argc, char **argv) cout << "Run tests on device " << device << " [" << info.name() << "] \n" << endl; } - testing::InitGoogleTest(&argc, argv); + InitGoogleTest(&argc, argv); perf::TestBase::Init(argc, argv); return RUN_ALL_TESTS(); } diff --git a/modules/gpu/test/main.cpp b/modules/gpu/test/main.cpp index 6df7db0a1..8f216c9fe 100644 --- a/modules/gpu/test/main.cpp +++ b/modules/gpu/test/main.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" #ifdef HAVE_CUDA @@ -49,93 +49,103 @@ using namespace cv::gpu; using namespace cvtest; using namespace testing; -void printInfo() +void printOsInfo() { #if defined _WIN32 # if defined _WIN64 - puts("OS: Windows x64"); + cout << "OS: Windows x64 \n" << endl; # else - puts("OS: Windows x32"); + cout << "OS: Windows x32 \n" << endl; # endif #elif defined linux # if defined _LP64 - puts("OS: Linux x64"); + cout << "OS: Linux x64 \n" << endl; # else - puts("OS: Linux x32"); + cout << "OS: Linux x32 \n" << endl; # endif #elif defined __APPLE__ # if defined _LP64 - puts("OS: Apple x64"); + cout << "OS: Apple x64 \n" << endl; # else - puts("OS: Apple x32"); + cout << "OS: Apple x32 \n" << endl; # endif #endif +} +void printCudaInfo() +{ +#ifndef HAVE_CUDA + cout << "OpenCV was built without CUDA support \n" << endl; +#else int driver; cudaDriverGetVersion(&driver); - printf("CUDA Driver version: %d\n", driver); - printf("CUDA Runtime version: %d\n", CUDART_VERSION); + cout << "CUDA Driver version: " << driver << '\n'; + cout << "CUDA Runtime version: " << CUDART_VERSION << '\n'; - puts("GPU module was compiled for the following GPU archs:"); - printf(" BIN: %s\n", CUDA_ARCH_BIN); - printf(" PTX: %s\n\n", CUDA_ARCH_PTX); + cout << endl; + + cout << "GPU module was compiled for the following GPU archs:" << endl; + cout << " BIN: " << CUDA_ARCH_BIN << '\n'; + cout << " PTX: " << CUDA_ARCH_PTX << '\n'; + + cout << endl; int deviceCount = getCudaEnabledDeviceCount(); - printf("CUDA device count: %d\n\n", deviceCount); + cout << "CUDA device count: " << deviceCount << '\n'; + + cout << endl; for (int i = 0; i < deviceCount; ++i) { DeviceInfo info(i); - printf("Device %d:\n", i); - printf(" Name: %s\n", info.name().c_str()); - printf(" Compute capability version: %d.%d\n", info.majorVersion(), info.minorVersion()); - printf(" Multi Processor Count: %d\n", info.multiProcessorCount()); - printf(" Total memory: %d Mb\n", static_cast(static_cast(info.totalMemory() / 1024.0) / 1024.0)); - printf(" Free memory: %d Mb\n", static_cast(static_cast(info.freeMemory() / 1024.0) / 1024.0)); + cout << "Device [" << i << "] \n"; + cout << "\t Name: " << info.name() << '\n'; + cout << "\t Compute capability: " << info.majorVersion() << '.' << info.minorVersion()<< '\n'; + cout << "\t Multi Processor Count: " << info.multiProcessorCount() << '\n'; + cout << "\t Total memory: " << static_cast(static_cast(info.totalMemory() / 1024.0) / 1024.0) << " Mb \n"; + cout << "\t Free memory: " << static_cast(static_cast(info.freeMemory() / 1024.0) / 1024.0) << " Mb \n"; if (!info.isCompatible()) - puts(" !!! This device is NOT compatible with current GPU module build\n"); - printf("\n"); + cout << "\t !!! This device is NOT compatible with current GPU module build \n"; + + cout << endl; } +#endif } -enum OutputLevel -{ - OutputLevelNone, - OutputLevelCompact, - OutputLevelFull -}; - -extern OutputLevel nvidiaTestOutputLevel; - int main(int argc, char** argv) { try { - CommandLineParser parser(argc, (const char**)argv, - "{ print_info_only | print_info_only | false | Print information about system and exit }" - "{ device | device | -1 | Device on which tests will be executed (-1 means all devices) }" - "{ nvtest_output_level | nvtest_output_level | compact | NVidia test verbosity level }"); + CommandLineParser cmd(argc, (const char**)argv, + "{ print_info_only | print_info_only | false | Print information about system and exit }" + "{ device | device | -1 | Device on which tests will be executed (-1 means all devices) }" + "{ nvtest_output_level | nvtest_output_level | compact | NVidia test verbosity level }" + ); - printInfo(); + printOsInfo(); + printCudaInfo(); - if (parser.get("print_info_only")) + if (cmd.get("print_info_only")) return 0; - int device = parser.get("device"); + int device = cmd.get("device"); if (device < 0) { DeviceManager::instance().loadAll(); - std::cout << "Run tests on all supported devices\n" << std::endl; + + cout << "Run tests on all supported devices \n" << endl; } else { DeviceManager::instance().load(device); - std::cout << "Run tests on device " << device << '\n' << std::endl; + + DeviceInfo info(device); + cout << "Run tests on device " << device << " [" << info.name() << "] \n" << endl; } - string outputLevel = parser.get("nvtest_output_level"); + string outputLevel = cmd.get("nvtest_output_level"); if (outputLevel == "none") nvidiaTestOutputLevel = OutputLevelNone; diff --git a/modules/gpu/test/main_test_nvidia.h b/modules/gpu/test/main_test_nvidia.h index d1c362012..15016ca64 100644 --- a/modules/gpu/test/main_test_nvidia.h +++ b/modules/gpu/test/main_test_nvidia.h @@ -1,7 +1,7 @@ #ifndef __main_test_nvidia_h__ #define __main_test_nvidia_h__ -#include +#include enum OutputLevel { @@ -10,6 +10,8 @@ enum OutputLevel OutputLevelFull }; +extern OutputLevel nvidiaTestOutputLevel; + bool nvidia_NPPST_Integral_Image(const std::string& test_data_path, OutputLevel outputLevel); bool nvidia_NPPST_Squared_Integral_Image(const std::string& test_data_path, OutputLevel outputLevel); bool nvidia_NPPST_RectStdDev(const std::string& test_data_path, OutputLevel outputLevel); diff --git a/modules/gpu/test/test_calib3d.cpp b/modules/gpu/test/test_calib3d.cpp index bdc043fc5..5fa1ebb41 100644 --- a/modules/gpu/test/test_calib3d.cpp +++ b/modules/gpu/test/test_calib3d.cpp @@ -39,7 +39,9 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" + +#ifdef HAVE_CUDA namespace { @@ -329,7 +331,7 @@ TEST_P(ReprojectImageTo3D, Accuracy) cv::gpu::GpuMat dst; cv::gpu::reprojectImageTo3D(loadMat(disp, useRoi), dst, Q, 3); - + cv::Mat dst_gold; cv::reprojectImageTo3D(disp, dst_gold, Q, false); @@ -343,3 +345,5 @@ INSTANTIATE_TEST_CASE_P(GPU_Calib3D, ReprojectImageTo3D, testing::Combine( WHOLE_SUBMAT)); } // namespace + +#endif // HAVE_CUDA diff --git a/modules/gpu/test/test_color.cpp b/modules/gpu/test/test_color.cpp index 645967ef2..c2929fbe7 100644 --- a/modules/gpu/test/test_color.cpp +++ b/modules/gpu/test/test_color.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" #ifdef HAVE_CUDA diff --git a/modules/gpu/test/test_copy_make_border.cpp b/modules/gpu/test/test_copy_make_border.cpp index 45b73d302..8bd5a66f9 100644 --- a/modules/gpu/test/test_copy_make_border.cpp +++ b/modules/gpu/test/test_copy_make_border.cpp @@ -39,7 +39,9 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" + +#ifdef HAVE_CUDA namespace { @@ -98,3 +100,5 @@ INSTANTIATE_TEST_CASE_P(GPU_ImgProc, CopyMakeBorder, testing::Combine( WHOLE_SUBMAT)); } // namespace + +#endif // HAVE_CUDA diff --git a/modules/gpu/test/test_core.cpp b/modules/gpu/test/test_core.cpp index 6502c4a05..09c6be1ac 100644 --- a/modules/gpu/test/test_core.cpp +++ b/modules/gpu/test/test_core.cpp @@ -39,7 +39,9 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" + +#ifdef HAVE_CUDA namespace { @@ -3396,3 +3398,5 @@ INSTANTIATE_TEST_CASE_P(GPU_Core, Reduce, testing::Combine( WHOLE_SUBMAT)); } // namespace + +#endif // HAVE_CUDA diff --git a/modules/gpu/test/test_features2d.cpp b/modules/gpu/test/test_features2d.cpp index d8ed864eb..b461d4b44 100644 --- a/modules/gpu/test/test_features2d.cpp +++ b/modules/gpu/test/test_features2d.cpp @@ -39,7 +39,9 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" + +#ifdef HAVE_CUDA namespace { @@ -984,3 +986,5 @@ INSTANTIATE_TEST_CASE_P(GPU_Features2D, BruteForceMatcher, testing::Combine( testing::Values(UseMask(false), UseMask(true)))); } // namespace + +#endif // HAVE_CUDA diff --git a/modules/gpu/test/test_filters.cpp b/modules/gpu/test/test_filters.cpp index 9df6ee27c..0781970e4 100644 --- a/modules/gpu/test/test_filters.cpp +++ b/modules/gpu/test/test_filters.cpp @@ -39,7 +39,9 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" + +#ifdef HAVE_CUDA namespace { @@ -552,3 +554,5 @@ INSTANTIATE_TEST_CASE_P(GPU_Filter, Filter2D, testing::Combine( WHOLE_SUBMAT)); } // namespace + +#endif // HAVE_CUDA diff --git a/modules/gpu/test/test_global_motion.cpp b/modules/gpu/test/test_global_motion.cpp index eb8b2f7c1..b37d08068 100644 --- a/modules/gpu/test/test_global_motion.cpp +++ b/modules/gpu/test/test_global_motion.cpp @@ -39,11 +39,11 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" + +#ifdef HAVE_CUDA -#include using namespace std; - using namespace cv; struct CompactPoints : testing::TestWithParam @@ -85,3 +85,5 @@ TEST_P(CompactPoints, CanCompactizeSmallInput) } INSTANTIATE_TEST_CASE_P(GPU_GlobalMotion, CompactPoints, ALL_DEVICES); + +#endif // HAVE_CUDA diff --git a/modules/gpu/test/test_gpumat.cpp b/modules/gpu/test/test_gpumat.cpp index 4dd419a18..862795759 100644 --- a/modules/gpu/test/test_gpumat.cpp +++ b/modules/gpu/test/test_gpumat.cpp @@ -40,7 +40,9 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" + +#ifdef HAVE_CUDA namespace { @@ -323,3 +325,5 @@ INSTANTIATE_TEST_CASE_P(GPU_GpuMat, ConvertTo, testing::Combine( WHOLE_SUBMAT)); } // namespace + +#endif // HAVE_CUDA diff --git a/modules/gpu/test/test_imgproc.cpp b/modules/gpu/test/test_imgproc.cpp index 4d67de59d..7a616a2e4 100644 --- a/modules/gpu/test/test_imgproc.cpp +++ b/modules/gpu/test/test_imgproc.cpp @@ -39,7 +39,9 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" + +#ifdef HAVE_CUDA namespace { @@ -1186,3 +1188,5 @@ INSTANTIATE_TEST_CASE_P(GPU_ImgProc, HoughLines, testing::Combine( std::string("../cv/shared/pic6.png")))); } // namespace + +#endif // HAVE_CUDA diff --git a/modules/gpu/test/test_labeling.cpp b/modules/gpu/test/test_labeling.cpp index c88109af1..46f6f4eeb 100644 --- a/modules/gpu/test/test_labeling.cpp +++ b/modules/gpu/test/test_labeling.cpp @@ -39,9 +39,7 @@ // the use of this software, even if advised of the possibility of such damage. //M*/ -#include "precomp.hpp" -#include -#include +#include "test_precomp.hpp" #ifdef HAVE_CUDA @@ -199,4 +197,4 @@ TEST_P(Labeling, ConnectedComponents) INSTANTIATE_TEST_CASE_P(ConnectedComponents, Labeling, ALL_DEVICES); -#endif \ No newline at end of file +#endif // HAVE_CUDA diff --git a/modules/gpu/test/test_nvidia.cpp b/modules/gpu/test/test_nvidia.cpp index 386a66cfd..3de355744 100644 --- a/modules/gpu/test/test_nvidia.cpp +++ b/modules/gpu/test/test_nvidia.cpp @@ -39,21 +39,15 @@ // //M*/ -#include -#include "precomp.hpp" +#include "test_precomp.hpp" + +OutputLevel nvidiaTestOutputLevel = OutputLevelCompact; #ifdef HAVE_CUDA using namespace cvtest; using namespace testing; -//enum OutputLevel -//{ -// OutputLevelNone, -// OutputLevelCompact, -// OutputLevelFull -//}; - struct NVidiaTest : TestWithParam { cv::gpu::DeviceInfo devInfo; @@ -73,8 +67,6 @@ struct NVidiaTest : TestWithParam struct NPPST : NVidiaTest {}; struct NCV : NVidiaTest {}; -OutputLevel nvidiaTestOutputLevel = OutputLevelCompact; - //TEST_P(NPPST, Integral) //{ // bool res = nvidia_NPPST_Integral_Image(path, nvidiaTestOutputLevel); diff --git a/modules/gpu/test/test_objdetect.cpp b/modules/gpu/test/test_objdetect.cpp index 927762b2b..957ee1165 100644 --- a/modules/gpu/test/test_objdetect.cpp +++ b/modules/gpu/test/test_objdetect.cpp @@ -39,8 +39,9 @@ // //M*/ -#include "precomp.hpp" -#include +#include "test_precomp.hpp" + +#ifdef HAVE_CUDA namespace { @@ -302,13 +303,13 @@ PARAM_TEST_CASE(LBP_Read_classifier, cv::gpu::DeviceInfo, int) TEST_P(LBP_Read_classifier, Accuracy) { - cv::gpu::CascadeClassifier_GPU classifier; + cv::gpu::CascadeClassifier_GPU classifier; std::string classifierXmlPath = std::string(cvtest::TS::ptr()->get_data_path()) + "lbpcascade/lbpcascade_frontalface.xml"; ASSERT_TRUE(classifier.load(classifierXmlPath)); } -INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_Read_classifier, - testing::Combine(ALL_DEVICES, testing::Values(0))); +INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_Read_classifier, + testing::Combine(ALL_DEVICES, testing::Values(0))); PARAM_TEST_CASE(LBP_classify, cv::gpu::DeviceInfo, int) @@ -344,7 +345,7 @@ TEST_P(LBP_classify, Accuracy) for (; it != rects.end(); ++it) cv::rectangle(markedImage, *it, CV_RGB(0, 0, 255)); - cv::gpu::CascadeClassifier_GPU gpuClassifier; + cv::gpu::CascadeClassifier_GPU gpuClassifier; ASSERT_TRUE(gpuClassifier.load(classifierXmlPath)); cv::gpu::GpuMat gpu_rects; @@ -352,23 +353,25 @@ TEST_P(LBP_classify, Accuracy) int count = gpuClassifier.detectMultiScale(tested, gpu_rects); cv::Mat downloaded(gpu_rects); - const cv::Rect* faces = downloaded.ptr(); + const cv::Rect* faces = downloaded.ptr(); for (int i = 0; i < count; i++) { cv::Rect r = faces[i]; #if defined (LOG_CASCADE_STATISTIC) - std::cout << r.x << " " << r.y << " " << r.width << " " << r.height << std::endl; + std::cout << r.x << " " << r.y << " " << r.width << " " << r.height << std::endl; cv::rectangle(markedImage, r , CV_RGB(255, 0, 0)); -#endif +#endif } #if defined (LOG_CASCADE_STATISTIC) - cv::imshow("Res", markedImage); cv::waitKey(); + cv::imshow("Res", markedImage); cv::waitKey(); #endif } INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_classify, - testing::Combine(ALL_DEVICES, testing::Values(0))); + testing::Combine(ALL_DEVICES, testing::Values(0))); } // namespace + +#endif // HAVE_CUDA diff --git a/modules/gpu/test/test_precomp.cpp b/modules/gpu/test/test_precomp.cpp index dfa724612..34acf2ae9 100644 --- a/modules/gpu/test/test_precomp.cpp +++ b/modules/gpu/test/test_precomp.cpp @@ -39,4 +39,4 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" diff --git a/modules/gpu/test/test_precomp.hpp b/modules/gpu/test/test_precomp.hpp index 753367cce..f6933d51c 100644 --- a/modules/gpu/test/test_precomp.hpp +++ b/modules/gpu/test/test_precomp.hpp @@ -59,6 +59,7 @@ #include #include "cvconfig.h" + #include "opencv2/core/core.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/calib3d/calib3d.hpp" @@ -72,6 +73,7 @@ #include "utility.hpp" #include "interpolation.hpp" +#include "main_test_nvidia.h" #ifdef HAVE_CUDA #include diff --git a/modules/gpu/test/test_pyramids.cpp b/modules/gpu/test/test_pyramids.cpp index d0bf37b37..1abd7841e 100644 --- a/modules/gpu/test/test_pyramids.cpp +++ b/modules/gpu/test/test_pyramids.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" #ifdef HAVE_CUDA diff --git a/modules/gpu/test/test_remap.cpp b/modules/gpu/test/test_remap.cpp index c61a89914..b83e5db07 100644 --- a/modules/gpu/test/test_remap.cpp +++ b/modules/gpu/test/test_remap.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" #ifdef HAVE_CUDA diff --git a/modules/gpu/test/test_resize.cpp b/modules/gpu/test/test_resize.cpp index 7a7aacab1..73b8d9fab 100644 --- a/modules/gpu/test/test_resize.cpp +++ b/modules/gpu/test/test_resize.cpp @@ -39,8 +39,7 @@ // //M*/ -#include "precomp.hpp" -#include +#include "test_precomp.hpp" #ifdef HAVE_CUDA diff --git a/modules/gpu/test/test_threshold.cpp b/modules/gpu/test/test_threshold.cpp index cb31c643b..e878e6dfa 100644 --- a/modules/gpu/test/test_threshold.cpp +++ b/modules/gpu/test/test_threshold.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" #ifdef HAVE_CUDA diff --git a/modules/gpu/test/test_video.cpp b/modules/gpu/test/test_video.cpp index 0ee66ba52..ca9442d69 100644 --- a/modules/gpu/test/test_video.cpp +++ b/modules/gpu/test/test_video.cpp @@ -39,7 +39,9 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" + +#ifdef HAVE_CUDA //#define DUMP @@ -865,3 +867,5 @@ TEST_P(VideoReader, Regression) INSTANTIATE_TEST_CASE_P(GPU_Video, VideoReader, testing::Combine( ALL_DEVICES, testing::Values(std::string("768x576.avi"), std::string("1920x1080.avi")))); + +#endif // HAVE_CUDA diff --git a/modules/gpu/test/test_warp_affine.cpp b/modules/gpu/test/test_warp_affine.cpp index 262937fbe..c81fef354 100644 --- a/modules/gpu/test/test_warp_affine.cpp +++ b/modules/gpu/test/test_warp_affine.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" #ifdef HAVE_CUDA diff --git a/modules/gpu/test/test_warp_perspective.cpp b/modules/gpu/test/test_warp_perspective.cpp index f14317015..83c170f2e 100644 --- a/modules/gpu/test/test_warp_perspective.cpp +++ b/modules/gpu/test/test_warp_perspective.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" #ifdef HAVE_CUDA diff --git a/modules/gpu/test/utility.cpp b/modules/gpu/test/utility.cpp index 148c9d202..cf3b0fc8c 100644 --- a/modules/gpu/test/utility.cpp +++ b/modules/gpu/test/utility.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "test_precomp.hpp" using namespace std; using namespace cv; @@ -182,105 +182,6 @@ void DeviceManager::loadAll() } } -class DevicesGenerator : public ParamGeneratorInterface -{ -public: - ~DevicesGenerator(); - - ParamIteratorInterface* Begin() const; - ParamIteratorInterface* End() const; - -private: - class Iterator : public ParamIteratorInterface - { - public: - Iterator(const ParamGeneratorInterface* base, vector::const_iterator iterator); - - virtual ~Iterator(); - - virtual const ParamGeneratorInterface* BaseGenerator() const; - - virtual void Advance(); - - virtual ParamIteratorInterface* Clone() const; - - virtual const DeviceInfo* Current() const; - - virtual bool Equals(const ParamIteratorInterface& other) const; - - private: - Iterator(const Iterator& other); - - const ParamGeneratorInterface* const base_; - vector::const_iterator iterator_; - - mutable DeviceInfo value_; - }; -}; - -DevicesGenerator::~DevicesGenerator() -{ -} - -ParamIteratorInterface* DevicesGenerator::Begin() const -{ - return new Iterator(this, DeviceManager::instance().values().begin()); -} - -ParamIteratorInterface* DevicesGenerator::End() const -{ - return new Iterator(this, DeviceManager::instance().values().end()); -} - -DevicesGenerator::Iterator::Iterator(const ParamGeneratorInterface* base, vector::const_iterator iterator) - : base_(base), iterator_(iterator) -{ -} - -DevicesGenerator::Iterator::~Iterator() -{ -} - -const ParamGeneratorInterface* DevicesGenerator::Iterator::BaseGenerator() const -{ - return base_; -} - -void DevicesGenerator::Iterator::Advance() -{ - ++iterator_; -} - -ParamIteratorInterface* DevicesGenerator::Iterator::Clone() const -{ - return new Iterator(*this); -} - -const DeviceInfo* DevicesGenerator::Iterator::Current() const -{ - value_ = *iterator_; - return &value_; -} - -bool DevicesGenerator::Iterator::Equals(const ParamIteratorInterface& other) const -{ - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << endl; - - return iterator_ == CheckedDowncastToActualType(&other)->iterator_; -} - -DevicesGenerator::Iterator::Iterator(const Iterator& other) : - ParamIteratorInterface(), base_(other.base_), iterator_(other.iterator_) -{ -} - -ParamGenerator DevicesGenerator_() -{ - return ParamGenerator(new DevicesGenerator); -} - ////////////////////////////////////////////////////////////////////// // Additional assertion diff --git a/modules/gpu/test/utility.hpp b/modules/gpu/test/utility.hpp index b36f177f6..f509b786a 100644 --- a/modules/gpu/test/utility.hpp +++ b/modules/gpu/test/utility.hpp @@ -94,9 +94,7 @@ private: std::vector devices_; }; -testing::internal::ParamGenerator DevicesGenerator_(); - -#define ALL_DEVICES DevicesGenerator_() +#define ALL_DEVICES testing::ValuesIn(DeviceManager::instance().values()) ////////////////////////////////////////////////////////////////////// // Additional assertion