|
|
|
@ -410,9 +410,13 @@ namespace std |
|
|
|
|
}; |
|
|
|
|
} // namespace std
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace cv { |
|
|
|
|
class GAPI_EXPORTS_W_SIMPLE GKernelPackage; |
|
|
|
|
|
|
|
|
|
namespace gapi { |
|
|
|
|
GAPI_EXPORTS cv::GKernelPackage combine(const cv::GKernelPackage &lhs, |
|
|
|
|
const cv::GKernelPackage &rhs); |
|
|
|
|
|
|
|
|
|
/// @private
|
|
|
|
|
class GFunctor |
|
|
|
|
{ |
|
|
|
@ -427,6 +431,7 @@ namespace gapi { |
|
|
|
|
private: |
|
|
|
|
const char* m_id; |
|
|
|
|
}; |
|
|
|
|
} // namespace gapi
|
|
|
|
|
|
|
|
|
|
/** \addtogroup gapi_compile_args
|
|
|
|
|
* @{ |
|
|
|
@ -463,7 +468,7 @@ namespace gapi { |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
/// @private
|
|
|
|
|
using M = std::unordered_map<std::string, std::pair<GBackend, GKernelImpl>>; |
|
|
|
|
using M = std::unordered_map<std::string, std::pair<cv::gapi::GBackend, cv::GKernelImpl>>; |
|
|
|
|
|
|
|
|
|
/// @private
|
|
|
|
|
M m_id_kernels; |
|
|
|
@ -500,10 +505,8 @@ namespace gapi { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public: |
|
|
|
|
void include(const GFunctor& functor) |
|
|
|
|
{ |
|
|
|
|
m_id_kernels[functor.id()] = std::make_pair(functor.backend(), functor.impl()); |
|
|
|
|
} |
|
|
|
|
void include(const cv::gapi::GFunctor& functor); |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Returns total number of kernels |
|
|
|
|
* in the package (across all backends included) |
|
|
|
@ -555,7 +558,7 @@ namespace gapi { |
|
|
|
|
* |
|
|
|
|
* @param backend backend which kernels to remove |
|
|
|
|
*/ |
|
|
|
|
void remove(const GBackend& backend); |
|
|
|
|
void remove(const cv::gapi::GBackend& backend); |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Remove all kernels implementing the given API from |
|
|
|
@ -595,7 +598,7 @@ namespace gapi { |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
template<typename KAPI> |
|
|
|
|
GBackend lookup() const |
|
|
|
|
cv::gapi::GBackend lookup() const |
|
|
|
|
{ |
|
|
|
|
return lookup(KAPI::id()).first; |
|
|
|
|
} |
|
|
|
@ -621,18 +624,14 @@ namespace gapi { |
|
|
|
|
* @param backend backend associated with the kernel |
|
|
|
|
* @param kernel_id a name/id of the kernel |
|
|
|
|
*/ |
|
|
|
|
void include(const cv::gapi::GBackend& backend, const std::string& kernel_id) |
|
|
|
|
{ |
|
|
|
|
removeAPI(kernel_id); |
|
|
|
|
m_id_kernels[kernel_id] = std::make_pair(backend, GKernelImpl{{}, {}}); |
|
|
|
|
} |
|
|
|
|
void include(const cv::gapi::GBackend& backend, const std::string& kernel_id); |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Lists all backends which are included into package |
|
|
|
|
* |
|
|
|
|
* @return vector of backends |
|
|
|
|
*/ |
|
|
|
|
std::vector<GBackend> backends() const; |
|
|
|
|
std::vector<cv::gapi::GBackend> backends() const; |
|
|
|
|
|
|
|
|
|
// TODO: Doxygen bug -- it wants me to place this comment
|
|
|
|
|
// here, not below.
|
|
|
|
@ -643,9 +642,17 @@ namespace gapi { |
|
|
|
|
* @param rhs "Right-hand-side" package in the process |
|
|
|
|
* @return a new kernel package. |
|
|
|
|
*/ |
|
|
|
|
friend GAPI_EXPORTS GKernelPackage combine(const GKernelPackage &lhs, |
|
|
|
|
const GKernelPackage &rhs); |
|
|
|
|
friend GAPI_EXPORTS GKernelPackage cv::gapi::combine(const GKernelPackage &lhs, |
|
|
|
|
const GKernelPackage &rhs); |
|
|
|
|
}; |
|
|
|
|
/** @} */ |
|
|
|
|
|
|
|
|
|
namespace gapi { |
|
|
|
|
using GKernelPackage = cv::GKernelPackage; // Keep backward compatibility
|
|
|
|
|
|
|
|
|
|
/** \addtogroup gapi_compile_args
|
|
|
|
|
* @{ |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Create a kernel package object containing kernels |
|
|
|
@ -695,10 +702,6 @@ namespace gapi { |
|
|
|
|
|
|
|
|
|
/** @} */ |
|
|
|
|
|
|
|
|
|
// FYI - this function is already commented above
|
|
|
|
|
GAPI_EXPORTS GKernelPackage combine(const GKernelPackage &lhs, |
|
|
|
|
const GKernelPackage &rhs); |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Combines multiple G-API kernel packages into one |
|
|
|
|
* |
|
|
|
@ -710,7 +713,7 @@ namespace gapi { |
|
|
|
|
* @return The resulting kernel package |
|
|
|
|
*/ |
|
|
|
|
template<typename... Ps> |
|
|
|
|
GKernelPackage combine(const GKernelPackage &a, const GKernelPackage &b, Ps&&... rest) |
|
|
|
|
cv::GKernelPackage combine(const cv::GKernelPackage &a, const cv::GKernelPackage &b, Ps&&... rest) |
|
|
|
|
{ |
|
|
|
|
return combine(a, combine(b, rest...)); |
|
|
|
|
} |
|
|
|
@ -733,7 +736,7 @@ namespace gapi { |
|
|
|
|
|
|
|
|
|
namespace detail |
|
|
|
|
{ |
|
|
|
|
template<> struct CompileArgTag<cv::gapi::GKernelPackage> |
|
|
|
|
template<> struct CompileArgTag<cv::GKernelPackage> |
|
|
|
|
{ |
|
|
|
|
static const char* tag() { return "gapi.kernel_package"; } |
|
|
|
|
}; |
|
|
|
|