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.
5 // Copyright (C) 2018-2019 Intel Corporation
8 #ifndef OPENCV_GAPI_GCOMPILER_HPP
9 #define OPENCV_GAPI_GCOMPILER_HPP
12 #include "opencv2/gapi/gcommon.hpp"
13 #include "opencv2/gapi/gkernel.hpp"
14 #include "opencv2/gapi/gcomputation.hpp"
16 #include <ade/execution_engine/execution_engine.hpp>
18 namespace cv { namespace gimpl {
20 // FIXME: exported for internal tests only!
21 class GAPI_EXPORTS GCompiler
23 const GComputation& m_c;
24 const GMetaArgs m_metas;
26 ade::ExecutionEngine m_e;
28 cv::gapi::GKernelPackage m_all_kernels;
30 void validateInputMeta();
31 void validateOutProtoArgs();
34 explicit GCompiler(const GComputation &c,
38 // The method which does everything...
41 // But is actually composed of this:
42 using GPtr = std::unique_ptr<ade::Graph>;
43 GPtr generateGraph(); // Unroll GComputation into a GModel
44 void runPasses(ade::Graph &g); // Apply all G-API passes on a GModel
45 void compileIslands(ade::Graph &g); // Instantiate GIslandExecutables in GIslandModel
46 GCompiled produceCompiled(GPtr &&pg); // Produce GCompiled from processed GModel
51 #endif // OPENCV_GAPI_GCOMPILER_HPP