1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
11 #ifndef BOOST_COMPUTE_INTEROP_OPENCV_OCL_HPP
12 #define BOOST_COMPUTE_INTEROP_OPENCV_OCL_HPP
14 #include <opencv2/ocl/ocl.hpp>
16 #include <boost/compute/buffer.hpp>
17 #include <boost/compute/context.hpp>
18 #include <boost/compute/command_queue.hpp>
23 context opencv_ocl_get_context()
25 void *ocl_context = cv::ocl::getoclContext();
30 return context(*(static_cast<cl_context *>(ocl_context)));
33 command_queue opencv_ocl_get_command_queue()
35 void *ocl_queue = cv::ocl::getoclCommandQueue();
37 return command_queue();
40 return command_queue(*(static_cast<cl_command_queue *>(ocl_queue)));
43 buffer opencv_ocl_get_buffer(const cv::ocl::oclMat &mat)
45 return buffer(reinterpret_cast<cl_mem>(mat.data));
48 } // end compute namespace
49 } // end boost namespace
51 #endif // BOOST_COMPUTE_INTEROP_OPENCV_OCL_HPP