Commit 6f848b85 authored by Maksim Shabunin's avatar Maksim Shabunin

Merge pull request #8068 from catree:thrust_tutorial

parents 9e9fd281 6eed6a8e
Using a cv::cuda::GpuMat with thrust Using a cv::cuda::GpuMat with thrust {#tutorial_gpu_thrust_interop}
=========================================== ===========================================
Goal Goal
...@@ -67,4 +67,4 @@ Next we will determine how many values are greater than 0 by using thrust::count ...@@ -67,4 +67,4 @@ Next we will determine how many values are greater than 0 by using thrust::count
@snippet samples/cpp/tutorial_code/gpu/gpu-thrust-interop/main.cu pred_greater @snippet samples/cpp/tutorial_code/gpu/gpu-thrust-interop/main.cu pred_greater
We will use those results to create an output buffer for storing the copied values, we will then use copy_if with the same predicate to populate the output buffer. We will use those results to create an output buffer for storing the copied values, we will then use copy_if with the same predicate to populate the output buffer.
Lastly we will download the values into a CPU mat for viewing. Lastly we will download the values into a CPU mat for viewing.
\ No newline at end of file
...@@ -13,3 +13,10 @@ run the OpenCV algorithms. ...@@ -13,3 +13,10 @@ run the OpenCV algorithms.
This will give a good grasp on how to approach coding on the GPU module, once you already know This will give a good grasp on how to approach coding on the GPU module, once you already know
how to handle the other modules. As a test case it will port the similarity methods from the how to handle the other modules. As a test case it will port the similarity methods from the
tutorial @ref tutorial_video_input_psnr_ssim to the GPU. tutorial @ref tutorial_video_input_psnr_ssim to the GPU.
- @subpage tutorial_gpu_thrust_interop
*Compatibility:* \>= OpenCV 3.0
This tutorial will show you how to wrap a GpuMat into a thrust iterator in order to be able to
use the functions in the thrust library.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment