mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 05:29:54 +08:00
experimental kernels for cuda
This commit is contained in:
parent
50d1d711de
commit
edcfa64d99
@ -63,7 +63,7 @@ namespace cv
|
||||
|
||||
struct Warp
|
||||
{
|
||||
static __forceinline__ __device__ int STRIDE() { return warpSize;
|
||||
static __forceinline__ __device__ int STRIDE() { return warpSize };
|
||||
static __forceinline__ __device__ int SHIFT() { return threadIdx.x & (warpSize - 1); }
|
||||
};
|
||||
|
||||
@ -77,8 +77,8 @@ namespace cv
|
||||
out[idx] = in[idx];
|
||||
}
|
||||
|
||||
template <class Worker, typename ForwardIterator, typename ForwardIterator>
|
||||
__forceinline__ __device__ void Copy(ForwardIterator beg, ForwardIterator end, OutIter out)
|
||||
template <class Worker, typename InIter, typename OutIter>
|
||||
__forceinline__ __device__ void Copy(InIter beg, InIter end, OutIter out)
|
||||
{
|
||||
int STRIDE = Worker::STRIDE();
|
||||
int SHIFT = Worker::SHIFT();
|
||||
@ -103,6 +103,19 @@ namespace cv
|
||||
for (; idx < length; idx += STRIDE, cur += STRIDE)
|
||||
out[idx] = cur;
|
||||
}
|
||||
|
||||
template <class Worker, typename OutIter>
|
||||
__forceinline__ __device__ void Yota(OutIter beg, OutIter end, int val)
|
||||
{
|
||||
int STRIDE = Worker::STRIDE();
|
||||
int SHIFT = Worker::SHIFT();
|
||||
|
||||
beg += SHIFT;
|
||||
val += SHIFT;
|
||||
|
||||
for (; beg < end; beg += STRIDE, val += STRIDE)
|
||||
*beg = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user