Merge pull request #14346 from anton-potapov:gapi_async

* Async API for GAPI

 - naive implementation as a starting point

* Fix namespace comment in header
This commit is contained in:
anton-potapov
2019-04-30 13:11:56 +03:00
committed by Alexander Alekhin
parent faca45a7ea
commit f5801ee7da
5 changed files with 546 additions and 0 deletions
@@ -0,0 +1,28 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
// Copyright (C) 2019 Intel Corporation
#ifndef OPENCV_GAPI_GCOMPILED_ASYNC_HPP
#define OPENCV_GAPI_GCOMPILED_ASYNC_HPP
#include <future>
#include <exception> //for std::exception_ptr
#include <functional> //for std::function
#include "opencv2/gapi/garg.hpp"
namespace cv {
//fwd declaration
class GCompiled;
namespace gapi{
namespace wip {
GAPI_EXPORTS void async(GCompiled& gcmpld, std::function<void(std::exception_ptr)>&& callback, GRunArgs &&ins, GRunArgsP &&outs);
GAPI_EXPORTS std::future<void> async(GCompiled& gcmpld, GRunArgs &&ins, GRunArgsP &&outs);
} // namespace gapi
} // namespace wip
} // namespace cv
#endif // OPENCV_GAPI_GCOMPILED_ASYNC_HPP
@@ -0,0 +1,29 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
// Copyright (C) 2019 Intel Corporation
#ifndef OPENCV_GAPI_GCOMPUTATION_ASYNC_HPP
#define OPENCV_GAPI_GCOMPUTATION_ASYNC_HPP
#include <future>
#include <exception> //for std::exception_ptr
#include <functional> //for std::function
#include "opencv2/gapi/garg.hpp" //for GRunArgs, GRunArgsP
#include "opencv2/gapi/gcommon.hpp" //for GCompileArgs
namespace cv {
//fwd declaration
class GComputation;
namespace gapi {
namespace wip {
GAPI_EXPORTS void async_apply(GComputation& gcomp, std::function<void(std::exception_ptr)>&& callback, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args = {});
GAPI_EXPORTS std::future<void> async_apply(GComputation& gcomp, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args = {});
} // nmaepspace gapi
} // namespace wip
} // namespace cv
#endif //OPENCV_GAPI_GCOMPUTATION_ASYNC_HPP