virtual bool supportBackend(int backendId) CV_OVERRIDE
{
- if(kernel_size.size() == 2 || kernel_size.size() == 3)
+ size_t ksize = kernel_size.size();
++#ifdef HAVE_CUDA
+ if (backendId == DNN_BACKEND_CUDA)
+ {
+ /* only convolution 2d and 3d supported */
-
++ if (ksize == 2 || ksize == 3)
+ return true;
+
+ return false;
+ }
++#endif
#ifdef HAVE_INF_ENGINE
if (backendId == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019 || backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
{
return false;
return (preferableTarget != DNN_TARGET_MYRIAD || dilation.width == dilation.height);
}
- else
#endif
- {
- if (kernel_size.size() == 3)
- return (preferableTarget == DNN_TARGET_CPU && backendId == DNN_BACKEND_OPENCV);
- else if (kernel_size.size() == 2)
- return backendId == DNN_BACKEND_OPENCV ||
- (backendId == DNN_BACKEND_HALIDE && !blobs.empty()) ||
- (backendId == DNN_BACKEND_VKCOM && haveVulkan());
- else
- return false;
- }
+ if (backendId == DNN_BACKEND_OPENCV)
+ return ksize >= 1 && ksize <= 3;
+ #ifdef HAVE_HALIDE
+ if (backendId == DNN_BACKEND_HALIDE)
+ return ksize == 2 && !blobs.empty();
+ #endif
++#ifdef HAVE_VULKAN
++ if (backendId == DNN_BACKEND_VKCOM)
++ return ksize == 2;
++#endif
+ return false;
}
bool getMemoryShapes(const std::vector<MatShape> &inputs,
# )
################################################################
ci.j_code.write("""
- // C++: enum {1}
+ // C++: enum {1} ({2})
public static final int
- {0};\n\n""".format((",\n"+" "*12).join(["%s = %s" % (c.name, c.value) for c in consts]), typeName)
- {0};\n\n""".format((",\n"+" "*12).join(["%s = %s" % (c.name, const_value(c.value)) for c in consts]), typeNameShort, typeName)
++ {0};\n\n""".format((",\n"+" "*12).join(["%s = %s" % (c.name, c.value) for c in consts]), typeNameShort, typeName)
)
else:
ci.j_code.write("""