fix compile-time errors, disable unsupported tests

pull/18060/head
YashasSamaga 4 years ago
parent 565f14655c
commit f0149cdae2
  1. 10
      modules/dnn/src/cuda/detection_output.cu
  2. 6
      modules/dnn/test/test_onnx_importer.cpp

@ -673,18 +673,22 @@ void launch_decode_boxes_kernel(const Stream& stream, Span<T> decoded_bboxes, Vi
launch_kernel(kernel, policy, decoded_bboxes, locations, priors, transpose_location, normalized_bbox, num_loc_classes, background_class_id, clip_width, clip_height); launch_kernel(kernel, policy, decoded_bboxes, locations, priors, transpose_location, normalized_bbox, num_loc_classes, background_class_id, clip_width, clip_height);
} }
template <class T, std::size_t current, class ...Args> static template <class T, unsigned int current, class ...Args> static
typename std::enable_if<current == 0, void> typename std::enable_if<current == 0, void>
::type dispatch_decode_bboxes(int selector, Args&& ...args) { ::type dispatch_decode_bboxes(int selector, Args&& ...args) {
if(selector == 0) if(selector == 0)
launch_decode_boxes_kernel<T, 0, 0, 0, 0>(std::forward<Args>(args)...); launch_decode_boxes_kernel<T, 0, 0, 0, 0>(std::forward<Args>(args)...);
} }
template <class T, std::size_t current, class ...Args> static template <class T, unsigned int current, class ...Args> static
typename std::enable_if<current != 0, void> typename std::enable_if<current != 0, void>
::type dispatch_decode_bboxes(int selector, Args&& ...args) { ::type dispatch_decode_bboxes(int selector, Args&& ...args) {
if(selector == current) if(selector == current)
launch_decode_boxes_kernel<T, current & 8, current & 4, current & 2, current & 1>(std::forward<Args>(args)...); launch_decode_boxes_kernel<T,
static_cast<bool>(current & 8),
static_cast<bool>(current & 4),
static_cast<bool>(current & 2),
static_cast<bool>(current & 1)>(std::forward<Args>(args)...);
else else
dispatch_decode_bboxes<T, current - 1, Args...>(selector, std::forward<Args>(args)...); dispatch_decode_bboxes<T, current - 1, Args...>(selector, std::forward<Args>(args)...);
} }

@ -120,6 +120,9 @@ TEST_P(Test_ONNX_layers, Convolution_variable_weight)
backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019) && target == DNN_TARGET_MYRIAD) backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019) && target == DNN_TARGET_MYRIAD)
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH); applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
if (backend == DNN_BACKEND_CUDA)
applyTestTag(CV_TEST_TAG_DNN_SKIP_CUDA); // not supported
String basename = "conv_variable_w"; String basename = "conv_variable_w";
Net net = readNetFromONNX(_tf("models/" + basename + ".onnx")); Net net = readNetFromONNX(_tf("models/" + basename + ".onnx"));
ASSERT_FALSE(net.empty()); ASSERT_FALSE(net.empty());
@ -147,6 +150,9 @@ TEST_P(Test_ONNX_layers, Convolution_variable_weight_bias)
backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019) && target == DNN_TARGET_MYRIAD) backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019) && target == DNN_TARGET_MYRIAD)
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH); applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
if (backend == DNN_BACKEND_CUDA)
applyTestTag(CV_TEST_TAG_DNN_SKIP_CUDA); // not supported
String basename = "conv_variable_wb"; String basename = "conv_variable_wb";
Net net = readNetFromONNX(_tf("models/" + basename + ".onnx")); Net net = readNetFromONNX(_tf("models/" + basename + ".onnx"));
ASSERT_FALSE(net.empty()); ASSERT_FALSE(net.empty());

Loading…
Cancel
Save