Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / fluid / modules / gapi / src / backends / ocl / goclkernel.cpp
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-2019 Intel Corporation
6
7
8 #include <cassert>
9
10 #include "opencv2/gapi/ocl/goclkernel.hpp"
11
12 const cv::UMat& cv::GOCLContext::inMat(int input)
13 {
14     return (inArg<cv::UMat>(input));
15 }
16
17 cv::UMat& cv::GOCLContext::outMatR(int output)
18 {
19     return (*(util::get<cv::UMat*>(m_results.at(output))));
20 }
21
22 const cv::gapi::own::Scalar& cv::GOCLContext::inVal(int input)
23 {
24     return inArg<cv::gapi::own::Scalar>(input);
25 }
26
27 cv::gapi::own::Scalar& cv::GOCLContext::outValR(int output)
28 {
29     return *util::get<cv::gapi::own::Scalar*>(m_results.at(output));
30 }
31
32 cv::detail::VectorRef& cv::GOCLContext::outVecRef(int output)
33 {
34     return util::get<cv::detail::VectorRef>(m_results.at(output));
35 }
36
37 cv::GOCLKernel::GOCLKernel()
38 {
39 }
40
41 cv::GOCLKernel::GOCLKernel(const GOCLKernel::F &f)
42     : m_f(f)
43 {
44 }
45
46 void cv::GOCLKernel::apply(GOCLContext &ctx)
47 {
48     CV_Assert(m_f);
49     m_f(ctx);
50 }