mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Fixed tabs in whitespace.
This commit is contained in:
parent
12dcb1555e
commit
7376c5311b
@ -23,13 +23,11 @@ The following code will produce an iterator for a GpuMat
|
||||
@snippet samples/cpp/tutorial_code/gpu/gpu-thrust-interop/Thrust_interop.hpp begin_itr
|
||||
@snippet samples/cpp/tutorial_code/gpu/gpu-thrust-interop/Thrust_interop.hpp end_itr
|
||||
|
||||
Our goal is to have an iterator that will start at the beginning of the matrix, and increment correctly to access continuous matrix elements. This is trivial for a continuous row, but how about for a column
|
||||
of a pitched matrix? To do this we need the iterator to be aware of the matrix dimensions and step. This information is embedded in the step_functor.
|
||||
Our goal is to have an iterator that will start at the beginning of the matrix, and increment correctly to access continuous matrix elements. This is trivial for a continuous row, but how about for a column of a pitched matrix? To do this we need the iterator to be aware of the matrix dimensions and step. This information is embedded in the step_functor.
|
||||
@snippet samples/cpp/tutorial_code/gpu/gpu-thrust-interop/Thrust_interop.hpp step_functor
|
||||
The step functor takes in an index value and returns the appropriate
|
||||
offset from the beginning of the matrix. The counting iterator simply increments over the range of pixel elements. Combined into the transform_iterator we have an iterator that counts from 0 to M*N and correctly
|
||||
increments to account for the pitched memory of a GpuMat. Unfortunately this does not include any memory location information, for that we need a thrust::device_ptr. By combining a device pointer with the
|
||||
transform_iterator we can point thrust to the first element of our matrix and have it step accordingly.
|
||||
increments to account for the pitched memory of a GpuMat. Unfortunately this does not include any memory location information, for that we need a thrust::device_ptr. By combining a device pointer with the transform_iterator we can point thrust to the first element of our matrix and have it step accordingly.
|
||||
|
||||
Fill a GpuMat with random numbers
|
||||
----
|
||||
@ -52,8 +50,7 @@ Lets fill matrix elements with random values and an index. Afterwards we will s
|
||||
|
||||
Copy values greater than 0 to a new gpu matrix while using streams
|
||||
----
|
||||
In this example we're going to see how cv::cuda::Streams can be used with thrust. Unfortunately this specific example uses functions that must return
|
||||
results to the CPU so it isn't the optimal use of streams.
|
||||
In this example we're going to see how cv::cuda::Streams can be used with thrust. Unfortunately this specific example uses functions that must return results to the CPU so it isn't the optimal use of streams.
|
||||
|
||||
@snippet samples/cpp/tutorial_code/gpu/gpu-thrust-interop/main.cu copy_greater
|
||||
|
||||
|
@ -51,9 +51,9 @@ thrust::permutation_iterator<thrust::device_ptr<T>, thrust::transform_iterator<s
|
||||
//! [begin_itr]
|
||||
//! [end_itr]
|
||||
/*
|
||||
@Brief GpuMatEndItr returns a thrust compatible iterator to the end of a GPU mat's memory.
|
||||
@Param mat is the input matrix
|
||||
@Param channel is the channel of the matrix that the iterator is accessing. If set to -1, the iterator will access every element in sequential order
|
||||
@Brief GpuMatEndItr returns a thrust compatible iterator to the end of a GPU mat's memory.
|
||||
@Param mat is the input matrix
|
||||
@Param channel is the channel of the matrix that the iterator is accessing. If set to -1, the iterator will access every element in sequential order
|
||||
*/
|
||||
template<typename T>
|
||||
thrust::permutation_iterator<thrust::device_ptr<T>, thrust::transform_iterator<step_functor<T>, thrust::counting_iterator<int>>> GpuMatEndItr(cv::cuda::GpuMat mat, int channel = 0)
|
||||
|
@ -19,7 +19,6 @@ struct prg
|
||||
thrust::default_random_engine rng;
|
||||
thrust::uniform_real_distribution<float> dist(a, b);
|
||||
rng.discard(n);
|
||||
|
||||
return dist(rng);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user