Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/gapi/src/compiler/gcompiled_priv.hpp
16337 views
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_GCOMPILED_PRIV_HPP
9
#define OPENCV_GAPI_GCOMPILED_PRIV_HPP
10
11
#include <memory> // unique_ptr
12
13
#include "opencv2/gapi/util/optional.hpp"
14
#include "compiler/gmodel.hpp"
15
#include "executor/gexecutor.hpp"
16
17
// NB: BTW, GCompiled is the only "public API" class which
18
// private part (implementaion) is hosted in the "compiler/" module.
19
//
20
// This file is here just to keep ADE hidden from the top-level APIs.
21
//
22
// As the thing becomes more complex, appropriate API and implementation
23
// part will be placed to api/ and compiler/ modules respectively.
24
25
namespace cv {
26
27
namespace gimpl
28
{
29
struct GRuntimeArgs;
30
};
31
32
// FIXME: GAPI_EXPORTS is here only due to tests and Windows linker issues
33
class GAPI_EXPORTS GCompiled::Priv
34
{
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;
40
41
void checkArgs(const cv::gimpl::GRuntimeArgs &args) const;
42
43
public:
44
void setup(const GMetaArgs &metaArgs,
45
const GMetaArgs &outMetas,
46
std::unique_ptr<cv::gimpl::GExecutor> &&pE);
47
bool isEmpty() const;
48
49
void run(cv::gimpl::GRuntimeArgs &&args);
50
const GMetaArgs& metas() const;
51
const GMetaArgs& outMetas() const;
52
53
const cv::gimpl::GModel::Graph& model() const;
54
};
55
56
}
57
58
#endif // OPENCV_GAPI_GCOMPILED_PRIV_HPP
59
60