mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Move GKernelPackage to cv namespace
This commit is contained in:
@@ -53,18 +53,18 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
cv::gapi::GKernelPackage getKernelPackage(cv::GCompileArgs &args)
|
||||
cv::GKernelPackage getKernelPackage(cv::GCompileArgs &args)
|
||||
{
|
||||
auto withAuxKernels = [](const cv::gapi::GKernelPackage& pkg) {
|
||||
cv::gapi::GKernelPackage aux_pkg;
|
||||
auto withAuxKernels = [](const cv::GKernelPackage& pkg) {
|
||||
cv::GKernelPackage aux_pkg;
|
||||
for (const auto &b : pkg.backends()) {
|
||||
aux_pkg = combine(aux_pkg, b.priv().auxiliaryKernels());
|
||||
aux_pkg = cv::gapi::combine(aux_pkg, b.priv().auxiliaryKernels());
|
||||
}
|
||||
// Always include built-in meta<> and copy implementation
|
||||
return combine(pkg,
|
||||
aux_pkg,
|
||||
cv::gimpl::meta::kernels(),
|
||||
cv::gimpl::streaming::kernels());
|
||||
return cv::gapi::combine(pkg,
|
||||
aux_pkg,
|
||||
cv::gimpl::meta::kernels(),
|
||||
cv::gimpl::streaming::kernels());
|
||||
};
|
||||
|
||||
auto has_use_only = cv::gapi::getCompileArg<cv::gapi::use_only>(args);
|
||||
@@ -73,18 +73,18 @@ namespace
|
||||
|
||||
static auto ocv_pkg =
|
||||
#if !defined(GAPI_STANDALONE)
|
||||
combine(cv::gapi::core::cpu::kernels(),
|
||||
cv::gapi::imgproc::cpu::kernels(),
|
||||
cv::gapi::video::cpu::kernels(),
|
||||
cv::gapi::render::ocv::kernels(),
|
||||
cv::gapi::streaming::kernels());
|
||||
cv::gapi::combine(cv::gapi::core::cpu::kernels(),
|
||||
cv::gapi::imgproc::cpu::kernels(),
|
||||
cv::gapi::video::cpu::kernels(),
|
||||
cv::gapi::render::ocv::kernels(),
|
||||
cv::gapi::streaming::kernels());
|
||||
#else
|
||||
cv::gapi::GKernelPackage();
|
||||
cv::GKernelPackage();
|
||||
#endif // !defined(GAPI_STANDALONE)
|
||||
|
||||
auto user_pkg = cv::gapi::getCompileArg<cv::gapi::GKernelPackage>(args);
|
||||
auto user_pkg_with_aux = withAuxKernels(user_pkg.value_or(cv::gapi::GKernelPackage{}));
|
||||
return combine(ocv_pkg, user_pkg_with_aux);
|
||||
auto user_pkg = cv::gapi::getCompileArg<cv::GKernelPackage>(args);
|
||||
auto user_pkg_with_aux = withAuxKernels(user_pkg.value_or(cv::GKernelPackage{}));
|
||||
return cv::gapi::combine(ocv_pkg, user_pkg_with_aux);
|
||||
}
|
||||
|
||||
cv::gapi::GNetPackage getNetworkPackage(cv::GCompileArgs &args)
|
||||
@@ -110,8 +110,8 @@ namespace
|
||||
}
|
||||
|
||||
template<typename C>
|
||||
cv::gapi::GKernelPackage auxKernelsFrom(const C& c) {
|
||||
cv::gapi::GKernelPackage result;
|
||||
cv::GKernelPackage auxKernelsFrom(const C& c) {
|
||||
cv::GKernelPackage result;
|
||||
for (const auto &b : c) {
|
||||
result = cv::gapi::combine(result, b.priv().auxiliaryKernels());
|
||||
}
|
||||
@@ -121,7 +121,7 @@ namespace
|
||||
using adeGraphs = std::vector<std::unique_ptr<ade::Graph>>;
|
||||
|
||||
// Creates ADE graphs (patterns and substitutes) from pkg's transformations
|
||||
void makeTransformationGraphs(const cv::gapi::GKernelPackage& pkg,
|
||||
void makeTransformationGraphs(const cv::GKernelPackage& pkg,
|
||||
adeGraphs& patterns,
|
||||
adeGraphs& substitutes) {
|
||||
const auto& transforms = pkg.get_transformations();
|
||||
@@ -142,7 +142,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
void checkTransformations(const cv::gapi::GKernelPackage& pkg,
|
||||
void checkTransformations(const cv::GKernelPackage& pkg,
|
||||
const adeGraphs& patterns,
|
||||
const adeGraphs& substitutes) {
|
||||
const auto& transforms = pkg.get_transformations();
|
||||
|
||||
@@ -26,7 +26,7 @@ class GAPI_EXPORTS GCompiler
|
||||
GCompileArgs m_args;
|
||||
ade::ExecutionEngine m_e;
|
||||
|
||||
cv::gapi::GKernelPackage m_all_kernels;
|
||||
cv::GKernelPackage m_all_kernels;
|
||||
cv::gapi::GNetPackage m_all_networks;
|
||||
|
||||
// Patterns built from transformations
|
||||
|
||||
@@ -157,7 +157,7 @@ void cv::gimpl::passes::bindNetParams(ade::passes::PassContext &ctx,
|
||||
// kernels, but if not, they are handled by the framework itself in
|
||||
// its optimization/execution passes.
|
||||
void cv::gimpl::passes::resolveKernels(ade::passes::PassContext &ctx,
|
||||
const gapi::GKernelPackage &kernels)
|
||||
const GKernelPackage &kernels)
|
||||
{
|
||||
std::unordered_set<cv::gapi::GBackend> active_backends;
|
||||
|
||||
@@ -220,7 +220,7 @@ void cv::gimpl::passes::resolveKernels(ade::passes::PassContext &ctx,
|
||||
gr.metadata().set(ActiveBackends{active_backends});
|
||||
}
|
||||
|
||||
void cv::gimpl::passes::expandKernels(ade::passes::PassContext &ctx, const gapi::GKernelPackage &kernels)
|
||||
void cv::gimpl::passes::expandKernels(ade::passes::PassContext &ctx, const GKernelPackage &kernels)
|
||||
{
|
||||
GModel::Graph gr(ctx.graph);
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ namespace ade {
|
||||
}
|
||||
}
|
||||
|
||||
namespace cv {
|
||||
|
||||
// Forward declarations - internal
|
||||
namespace gapi {
|
||||
namespace cv {
|
||||
class GKernelPackage;
|
||||
|
||||
namespace gapi {
|
||||
struct GNetPackage;
|
||||
} // namespace gapi
|
||||
|
||||
@@ -52,20 +52,20 @@ void inferMeta(ade::passes::PassContext &ctx, bool meta_is_initialized);
|
||||
void storeResultingMeta(ade::passes::PassContext &ctx);
|
||||
|
||||
void expandKernels(ade::passes::PassContext &ctx,
|
||||
const gapi::GKernelPackage& kernels);
|
||||
const GKernelPackage& kernels);
|
||||
|
||||
void bindNetParams(ade::passes::PassContext &ctx,
|
||||
const gapi::GNetPackage &networks);
|
||||
|
||||
void resolveKernels(ade::passes::PassContext &ctx,
|
||||
const gapi::GKernelPackage &kernels);
|
||||
const GKernelPackage &kernels);
|
||||
|
||||
void fuseIslands(ade::passes::PassContext &ctx);
|
||||
void syncIslandTags(ade::passes::PassContext &ctx);
|
||||
void topoSortIslands(ade::passes::PassContext &ctx);
|
||||
|
||||
void applyTransformations(ade::passes::PassContext &ctx,
|
||||
const gapi::GKernelPackage &pkg,
|
||||
const GKernelPackage &pkg,
|
||||
const std::vector<std::unique_ptr<ade::Graph>> &preGeneratedPatterns);
|
||||
|
||||
void addStreaming(ade::passes::PassContext &ctx);
|
||||
|
||||
@@ -99,7 +99,7 @@ bool tryToSubstitute(ade::Graph& main,
|
||||
} // anonymous namespace
|
||||
|
||||
void applyTransformations(ade::passes::PassContext& ctx,
|
||||
const gapi::GKernelPackage& pkg,
|
||||
const GKernelPackage& pkg,
|
||||
const std::vector<std::unique_ptr<ade::Graph>>& patterns)
|
||||
{
|
||||
const auto& transforms = pkg.get_transformations();
|
||||
|
||||
Reference in New Issue
Block a user