@@ -74,6 +74,16 @@ static int PARAM_DNN_BACKEND_DEFAULT = (int)utils::getConfigurationParameterSize
74
74
#endif
75
75
);
76
76
77
+ // Additional checks (slowdowns execution!)
78
+ static bool DNN_CHECK_NAN_INF = utils::getConfigurationParameterBool(" OPENCV_DNN_CHECK_NAN_INF" , false );
79
+ static bool DNN_CHECK_NAN_INF_DUMP = utils::getConfigurationParameterBool(" OPENCV_DNN_CHECK_NAN_INF_DUMP" , false );
80
+ static bool DNN_CHECK_NAN_INF_RAISE_ERROR = utils::getConfigurationParameterBool(" OPENCV_DNN_CHECK_NAN_INF_RAISE_ERROR" , false );
81
+
82
+ using std::vector;
83
+ using std::map;
84
+ using std::make_pair;
85
+ using std::set;
86
+
77
87
// ==================================================================================================
78
88
79
89
class BackendRegistry
@@ -160,6 +170,9 @@ std::vector< std::pair<Backend, Target> > getAvailableBackends()
160
170
161
171
std::vector<Target> getAvailableTargets (Backend be)
162
172
{
173
+ if (be == DNN_BACKEND_DEFAULT)
174
+ be = (Backend)PARAM_DNN_BACKEND_DEFAULT;
175
+
163
176
std::vector<Target> result;
164
177
const BackendRegistry::BackendsList all_backends = getAvailableBackends ();
165
178
for (BackendRegistry::BackendsList::const_iterator i = all_backends.begin (); i != all_backends.end (); ++i )
@@ -172,16 +185,6 @@ std::vector<Target> getAvailableTargets(Backend be)
172
185
173
186
// ==================================================================================================
174
187
175
- // Additional checks (slowdowns execution!)
176
- static bool DNN_CHECK_NAN_INF = utils::getConfigurationParameterBool(" OPENCV_DNN_CHECK_NAN_INF" , false );
177
- static bool DNN_CHECK_NAN_INF_DUMP = utils::getConfigurationParameterBool(" OPENCV_DNN_CHECK_NAN_INF_DUMP" , false );
178
- static bool DNN_CHECK_NAN_INF_RAISE_ERROR = utils::getConfigurationParameterBool(" OPENCV_DNN_CHECK_NAN_INF_RAISE_ERROR" , false );
179
-
180
- using std::vector;
181
- using std::map;
182
- using std::make_pair;
183
- using std::set;
184
-
185
188
namespace
186
189
{
187
190
typedef std::vector<MatShape> ShapesVec;
0 commit comments