1// This file is part of OpenCV project.
2// It is subject to the license terms in the LICENSE file found in the top-level directory
3// of this distribution and at http://opencv.org/license.html.
4//
5// Copyright (C) 2018 Intel Corporation
6
7
8#ifndef OPENCV_GAPI_COMPILER_PASSES_HPP
9#define OPENCV_GAPI_COMPILER_PASSES_HPP
10
11#include <ostream>
12#include <ade/passes/pass_base.hpp>
13
14#include "opencv2/gapi/garg.hpp"
15#include "opencv2/gapi/gcommon.hpp"
16
17// Forward declarations - external
18namespace ade {
19 class Graph;
20
21 namespace passes {
22 struct PassContext;
23 }
24}
25
26// Forward declarations - internal
27namespace cv {
28 class GKernelPackage;
29
30namespace gapi {
31 struct GNetPackage;
32} // namespace gapi
33
34namespace gimpl {
35
36bool is_intrinsic(const std::string &op_name);
37
38namespace passes {
39
40void dumpDot(const ade::Graph &g, std::ostream& os);
41void dumpDot(ade::passes::PassContext &ctx, std::ostream& os);
42void dumpDotStdout(ade::passes::PassContext &ctx);
43void dumpGraph(ade::passes::PassContext &ctx, const std::string& dump_path);
44void dumpDotToFile(ade::passes::PassContext &ctx, const std::string& dump_path);
45
46void initIslands(ade::passes::PassContext &ctx);
47void checkIslands(ade::passes::PassContext &ctx);
48void checkIslandsContent(ade::passes::PassContext &ctx);
49
50void initMeta(ade::passes::PassContext &ctx, const GMetaArgs &metas);
51void inferMeta(ade::passes::PassContext &ctx, bool meta_is_initialized);
52void storeResultingMeta(ade::passes::PassContext &ctx);
53
54void expandKernels(ade::passes::PassContext &ctx,
55 const GKernelPackage& kernels);
56
57void bindNetParams(ade::passes::PassContext &ctx,
58 const gapi::GNetPackage &networks);
59
60void resolveKernels(ade::passes::PassContext &ctx,
61 const GKernelPackage &kernels);
62
63void fuseIslands(ade::passes::PassContext &ctx);
64void syncIslandTags(ade::passes::PassContext &ctx);
65void topoSortIslands(ade::passes::PassContext &ctx);
66
67void applyTransformations(ade::passes::PassContext &ctx,
68 const GKernelPackage &pkg,
69 const std::vector<std::unique_ptr<ade::Graph>> &preGeneratedPatterns);
70
71void addStreaming(ade::passes::PassContext &ctx);
72
73void intrinDesync(ade::passes::PassContext &ctx);
74void intrinFinalize(ade::passes::PassContext &ctx);
75
76}} // namespace gimpl::passes
77
78} // namespace cv
79
80#endif // OPENCV_GAPI_COMPILER_PASSES_HPP
81

source code of opencv/modules/gapi/src/compiler/passes/passes.hpp