Merge pull request #21374 from cudawarped:fix_cuda_event_flags
authorcudawarped <mail@jamesbowley.co.uk>
Tue, 11 Jan 2022 20:57:25 +0000 (20:57 +0000)
committerGitHub <noreply@github.com>
Tue, 11 Jan 2022 20:57:25 +0000 (23:57 +0300)
Allow cv::cuda::Event to accept combinations of flags

modules/core/include/opencv2/core/cuda.hpp
modules/core/src/cuda_stream.cpp

index 716b8bf..719003f 100644 (file)
@@ -924,7 +924,7 @@ public:
         INTERPROCESS   = 0x04   /**< Event is suitable for interprocess use. DisableTiming must be set */
     };
 
-    CV_WRAP explicit Event(Event::CreateFlags flags = Event::CreateFlags::DEFAULT);
+    CV_WRAP explicit Event(const Event::CreateFlags flags = Event::CreateFlags::DEFAULT);
 
     //! records an event
     CV_WRAP void record(Stream& stream = Stream::Null());
@@ -946,6 +946,7 @@ private:
 
     friend struct EventAccessor;
 };
+CV_ENUM_FLAGS(Event::CreateFlags)
 
 //! @} cudacore_struct
 
index 3680e07..3f647c8 100644 (file)
@@ -811,7 +811,7 @@ Event cv::cuda::EventAccessor::wrapEvent(cudaEvent_t event)
 
 #endif
 
-cv::cuda::Event::Event(CreateFlags flags)
+cv::cuda::Event::Event(const Event::CreateFlags flags)
 {
 #ifndef HAVE_CUDA
     CV_UNUSED(flags);