cuda::StreamAccessor::wrapStream and cuda::EventAccessor::wrapEvent

to import existed CUDA stream or CUDA event to OpenCV
This commit is contained in:
Vladislav Vinogradov
2015-11-12 13:38:29 +03:00
parent b4112a5878
commit 39854ceda4
5 changed files with 72 additions and 16 deletions

View File

@@ -528,6 +528,7 @@ public:
private:
Ptr<Impl> impl_;
Event(const Ptr<Impl>& impl);
friend struct EventAccessor;
};

View File

@@ -540,6 +540,16 @@ Stream::Stream(const Ptr<Impl>& impl)
{
}
//===================================================================================
// Event
//===================================================================================
inline
Event::Event(const Ptr<Impl>& impl)
: impl_(impl)
{
}
//===================================================================================
// Initialization & Info
//===================================================================================

View File

@@ -52,7 +52,7 @@
*/
#include <cuda_runtime.h>
#include "opencv2/core/cvdef.h"
#include "opencv2/core/cuda.hpp"
namespace cv
{
@@ -62,14 +62,12 @@ namespace cv
//! @addtogroup cudacore_struct
//! @{
class Stream;
class Event;
/** @brief Class that enables getting cudaStream_t from cuda::Stream
*/
struct StreamAccessor
{
CV_EXPORTS static cudaStream_t getStream(const Stream& stream);
CV_EXPORTS static Stream wrapStream(cudaStream_t stream);
};
/** @brief Class that enables getting cudaEvent_t from cuda::Event
@@ -77,6 +75,7 @@ namespace cv
struct EventAccessor
{
CV_EXPORTS static cudaEvent_t getEvent(const Event& event);
CV_EXPORTS static Event wrapEvent(cudaEvent_t event);
};
//! @}