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_GCOMPILED_PRIV_HPP
9 #define OPENCV_GAPI_GCOMPILED_PRIV_HPP
11 #include <memory> // unique_ptr
13 #include "opencv2/gapi/util/optional.hpp"
14 #include "compiler/gmodel.hpp"
15 #include "executor/gexecutor.hpp"
17 // NB: BTW, GCompiled is the only "public API" class which
18 // private part (implementaion) is hosted in the "compiler/" module.
20 // This file is here just to keep ADE hidden from the top-level APIs.
22 // As the thing becomes more complex, appropriate API and implementation
23 // part will be placed to api/ and compiler/ modules respectively.
32 // FIXME: GAPI_EXPORTS is here only due to tests and Windows linker issues
33 class GAPI_EXPORTS GCompiled::Priv
35 // NB: For now, a GCompiled keeps the original ade::Graph alive.
36 // If we want to go autonomous, we might to do something with this.
37 GMetaArgs m_metas; // passed by user
38 GMetaArgs m_outMetas; // inferred by compiler
39 std::unique_ptr<cv::gimpl::GExecutor> m_exec;
41 void checkArgs(const cv::gimpl::GRuntimeArgs &args) const;
44 void setup(const GMetaArgs &metaArgs,
45 const GMetaArgs &outMetas,
46 std::unique_ptr<cv::gimpl::GExecutor> &&pE);
49 bool canReshape() const;
50 void reshape(const GMetaArgs& inMetas, const GCompileArgs &args);
52 void run(cv::gimpl::GRuntimeArgs &&args);
53 const GMetaArgs& metas() const;
54 const GMetaArgs& outMetas() const;
56 const cv::gimpl::GModel::Graph& model() const;
61 #endif // OPENCV_GAPI_GCOMPILED_PRIV_HPP