|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef OPENCV_GAPI_GCOMPILER_HPP
|
|
|
#define OPENCV_GAPI_GCOMPILER_HPP
|
|
|
|
|
|
|
|
|
#include <opencv2/gapi/gcommon.hpp>
|
|
|
#include <opencv2/gapi/gkernel.hpp>
|
|
|
#include <opencv2/gapi/infer.hpp>
|
|
|
#include <opencv2/gapi/gcomputation.hpp>
|
|
|
|
|
|
#include <ade/execution_engine/execution_engine.hpp>
|
|
|
|
|
|
namespace cv { namespace gimpl {
|
|
|
|
|
|
|
|
|
class GAPI_EXPORTS GCompiler
|
|
|
{
|
|
|
const GComputation& m_c;
|
|
|
const GMetaArgs m_metas;
|
|
|
GCompileArgs m_args;
|
|
|
ade::ExecutionEngine m_e;
|
|
|
|
|
|
cv::GKernelPackage m_all_kernels;
|
|
|
cv::gapi::GNetPackage m_all_networks;
|
|
|
|
|
|
|
|
|
std::vector<std::unique_ptr<ade::Graph>> m_all_patterns;
|
|
|
|
|
|
|
|
|
void validateInputMeta();
|
|
|
void validateOutProtoArgs();
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
explicit GCompiler(const GComputation &c,
|
|
|
GMetaArgs &&metas,
|
|
|
GCompileArgs &&args);
|
|
|
|
|
|
|
|
|
GCompiled compile();
|
|
|
|
|
|
|
|
|
GStreamingCompiled compileStreaming();
|
|
|
|
|
|
|
|
|
using GPtr = std::unique_ptr<ade::Graph>;
|
|
|
GPtr generateGraph();
|
|
|
void runPasses(ade::Graph &g);
|
|
|
void compileIslands(ade::Graph &g);
|
|
|
static void compileIslands(ade::Graph &g, const cv::GCompileArgs &args);
|
|
|
GCompiled produceCompiled(GPtr &&pg);
|
|
|
GStreamingCompiled produceStreamingCompiled(GPtr &&pg);
|
|
|
static void runMetaPasses(ade::Graph &g, const cv::GMetaArgs &metas);
|
|
|
|
|
|
static GPtr makeGraph(const cv::GComputation::Priv &);
|
|
|
};
|
|
|
|
|
|
}}
|
|
|
|
|
|
#endif
|
|
|
|