|
42 | 42 | #include "test_precomp.hpp"
|
43 | 43 | #include "npy_blob.hpp"
|
44 | 44 | #include <opencv2/dnn/shape_utils.hpp>
|
45 |
| -#include <opencv2/core/ocl.hpp> |
46 |
| -#include <opencv2/ts/ocl_test.hpp> |
47 | 45 |
|
48 | 46 | namespace opencv_test { namespace {
|
49 | 47 |
|
50 |
| -CV_ENUM(DNNTarget, DNN_TARGET_CPU, DNN_TARGET_OPENCL) |
51 |
| -static testing::internal::ParamGenerator<DNNTarget> availableBackends() |
52 |
| -{ |
53 |
| - static std::vector<DNNTarget> targets; |
54 |
| - if (targets.empty()) |
55 |
| - { |
56 |
| - targets.push_back(DNN_TARGET_CPU); |
57 |
| -#ifdef HAVE_OPENCL |
58 |
| - if (cv::ocl::useOpenCL()) |
59 |
| - targets.push_back(DNN_TARGET_OPENCL); |
60 |
| -#endif |
61 |
| - } |
62 |
| - return testing::ValuesIn(targets); |
63 |
| -} |
64 |
| - |
65 | 48 | template<typename TString>
|
66 | 49 | static std::string _tf(TString filename)
|
67 | 50 | {
|
@@ -132,7 +115,7 @@ TEST_P(Reproducibility_AlexNet, Accuracy)
|
132 | 115 | normAssert(ref, out);
|
133 | 116 | }
|
134 | 117 |
|
135 |
| -INSTANTIATE_TEST_CASE_P(/**/, Reproducibility_AlexNet, Combine(testing::Bool(), availableBackends())); |
| 118 | +INSTANTIATE_TEST_CASE_P(/**/, Reproducibility_AlexNet, Combine(testing::Bool(), availableDnnTargets())); |
136 | 119 |
|
137 | 120 | #if !defined(_WIN32) || defined(_WIN64)
|
138 | 121 | TEST(Reproducibility_FCN, Accuracy)
|
@@ -232,7 +215,7 @@ TEST_P(Reproducibility_MobileNet_SSD, Accuracy)
|
232 | 215 | normAssert(outBatch.rowRange(0, numDetections), ref);
|
233 | 216 | normAssert(outBatch.rowRange(numDetections, 2 * numDetections).colRange(1, 7), ref.colRange(1, 7));
|
234 | 217 | }
|
235 |
| -INSTANTIATE_TEST_CASE_P(/**/, Reproducibility_MobileNet_SSD, availableBackends()); |
| 218 | +INSTANTIATE_TEST_CASE_P(/**/, Reproducibility_MobileNet_SSD, availableDnnTargets()); |
236 | 219 |
|
237 | 220 | typedef testing::TestWithParam<DNNTarget> Reproducibility_ResNet50;
|
238 | 221 | TEST_P(Reproducibility_ResNet50, Accuracy)
|
@@ -263,7 +246,7 @@ TEST_P(Reproducibility_ResNet50, Accuracy)
|
263 | 246 | normAssert(ref, out_umats[0], "out_umat_vector");
|
264 | 247 | }
|
265 | 248 | }
|
266 |
| -INSTANTIATE_TEST_CASE_P(/**/, Reproducibility_ResNet50, availableBackends()); |
| 249 | +INSTANTIATE_TEST_CASE_P(/**/, Reproducibility_ResNet50, availableDnnTargets()); |
267 | 250 |
|
268 | 251 | typedef testing::TestWithParam<DNNTarget> Reproducibility_SqueezeNet_v1_1;
|
269 | 252 | TEST_P(Reproducibility_SqueezeNet_v1_1, Accuracy)
|
@@ -291,7 +274,7 @@ TEST_P(Reproducibility_SqueezeNet_v1_1, Accuracy)
|
291 | 274 | Mat ref = blobFromNPY(_tf("squeezenet_v1.1_prob.npy"));
|
292 | 275 | normAssert(ref, out);
|
293 | 276 | }
|
294 |
| -INSTANTIATE_TEST_CASE_P(/**/, Reproducibility_SqueezeNet_v1_1, availableBackends()); |
| 277 | +INSTANTIATE_TEST_CASE_P(/**/, Reproducibility_SqueezeNet_v1_1, availableDnnTargets()); |
295 | 278 |
|
296 | 279 | TEST(Reproducibility_AlexNet_fp16, Accuracy)
|
297 | 280 | {
|
|
0 commit comments