Skip to content

Allow cv::cuda::Event to accept combinations of flags#21374

Merged
alalek merged 15 commits intoopencv:4.xfrom
cudawarped:fix_cuda_event_flags
Jan 11, 2022
Merged

Allow cv::cuda::Event to accept combinations of flags#21374
alalek merged 15 commits intoopencv:4.xfrom
cudawarped:fix_cuda_event_flags

Conversation

@cudawarped
Copy link
Copy Markdown
Contributor

@cudawarped cudawarped commented Dec 31, 2021

Allow cv::cuda::Event to accept combinations of flags as implied by the Nvidia docs:

  • cudaEventDisableTiming: Specifies that the created event does not need to record timing data. Events created with this flag specified and the cudaEventBlockingSync flag not specified will provide the best performance when used with cudaStreamWaitEvent() and cudaEventQuery().

  • cudaEventInterprocess: Specifies that the created event may be used as an interprocess event by cudaIpcGetEventHandle(). cudaEventInterprocess must be specified along with cudaEventDisableTiming.

Currently there are no event tests, these have been added to opencv/opencv_contrib#3144.

Additionaly there are currently two Event and Stream classes inside the repo, one inside cv::cuda and one inside cv::dnn::cuda4dnn::csl. Is there any requirement to merge them or have them inherit from the same base class?

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake
opencv_contrib=test_cuda_event
force_builders=Custom
buildworker:Custom=linux-4,linux-6
Xbuild_image:Custom=ubuntu-cuda:18.04
build_image:Custom=ubuntu-cuda-cc52:18.04

};

CV_WRAP explicit Event(Event::CreateFlags flags = Event::CreateFlags::DEFAULT);
CV_WRAP explicit Event(const unsigned flags = Event::CreateFlags::DEFAULT);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you try to reuse CV_ENUM_FLAGS(...) approach instead?

@alalek alalek merged commit ecfbaa2 into opencv:4.x Jan 11, 2022
@alalek alalek mentioned this pull request Feb 22, 2022
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
Allow cv::cuda::Event to accept combinations of flags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: gpu/cuda (contrib) OpenCV 4.0+: moved to opencv_contrib feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants