1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Replace DNNTarget and DNNBackend in tests

This commit is contained in:
Dmitry Kurtaev
2018-03-07 12:59:38 +03:00
parent e1c3237532
commit 0a61ebdd66
5 changed files with 27 additions and 61 deletions
+2 -18
View File
@@ -42,7 +42,6 @@
#include "test_precomp.hpp"
#include "npy_blob.hpp"
#include <opencv2/dnn/shape_utils.hpp>
#include <opencv2/ts/ocl_test.hpp>
namespace opencv_test
{
@@ -62,21 +61,6 @@ static std::string _tf(TStr filename, bool inTorchDir = true)
return findDataFile(path, false);
}
CV_ENUM(DNNTarget, DNN_TARGET_CPU, DNN_TARGET_OPENCL)
static testing::internal::ParamGenerator<DNNTarget> availableBackends()
{
static std::vector<DNNTarget> targets;
if (targets.empty())
{
targets.push_back(DNN_TARGET_CPU);
#ifdef HAVE_OPENCL
if (cv::ocl::useOpenCL())
targets.push_back(DNN_TARGET_OPENCL);
#endif
}
return testing::ValuesIn(targets);
}
TEST(Torch_Importer, simple_read)
{
Net net;
@@ -221,7 +205,7 @@ TEST_P(Test_Torch_layers, net_non_spatial)
runTorchNet("net_non_spatial", GetParam(), "", false, true);
}
INSTANTIATE_TEST_CASE_P(/**/, Test_Torch_layers, availableBackends());
INSTANTIATE_TEST_CASE_P(/**/, Test_Torch_layers, availableDnnTargets());
typedef testing::TestWithParam<DNNTarget> Test_Torch_nets;
@@ -323,7 +307,7 @@ TEST_P(Test_Torch_nets, FastNeuralStyle_accuracy)
}
}
INSTANTIATE_TEST_CASE_P(/**/, Test_Torch_nets, availableBackends());
INSTANTIATE_TEST_CASE_P(/**/, Test_Torch_nets, availableDnnTargets());
// TODO: fix OpenCL and add to the rest of tests
TEST(Torch_Importer, run_paralel)