cuda::StreamAccessor::wrapStream and cuda::EventAccessor::wrapEvent
to import existed CUDA stream or CUDA event to OpenCV
This commit is contained in:
@@ -528,6 +528,7 @@ public:
|
||||
|
||||
private:
|
||||
Ptr<Impl> impl_;
|
||||
Event(const Ptr<Impl>& impl);
|
||||
|
||||
friend struct EventAccessor;
|
||||
};
|
||||
|
@@ -540,6 +540,16 @@ Stream::Stream(const Ptr<Impl>& impl)
|
||||
{
|
||||
}
|
||||
|
||||
//===================================================================================
|
||||
// Event
|
||||
//===================================================================================
|
||||
|
||||
inline
|
||||
Event::Event(const Ptr<Impl>& impl)
|
||||
: impl_(impl)
|
||||
{
|
||||
}
|
||||
|
||||
//===================================================================================
|
||||
// Initialization & Info
|
||||
//===================================================================================
|
||||
|
@@ -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);
|
||||
};
|
||||
|
||||
//! @}
|
||||
|
Reference in New Issue
Block a user