Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
08910e81
Commit
08910e81
authored
Nov 14, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integrate pre-Kepler architectures
parent
aa92be34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
5 deletions
+26
-5
isf-sc.cu
modules/gpu/src/cuda/isf-sc.cu
+15
-0
softcascade.cpp
modules/gpu/src/softcascade.cpp
+11
-5
No files found.
modules/gpu/src/cuda/isf-sc.cu
View file @
08910e81
...
...
@@ -209,6 +209,7 @@ __device void CascadeInvoker<Policy>::detect(Detection* objects, const uint ndet
const int lShift = (next - 1) * 2 + (int)(sum >= threshold);
float impact = leaves[(st + threadIdx.x) * 4 + lShift];
#if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 300
#pragma unroll
// scan on shuffl functions
for (int i = 1; i < Policy::WARP; i *= 2)
...
...
@@ -218,7 +219,21 @@ __device void CascadeInvoker<Policy>::detect(Detection* objects, const uint ndet
if (threadIdx.x >= i)
impact += n;
}
#else
__shared__ volatile float ptr[Policy::STA_X * Policy::STA_Y];
const int idx = threadIdx.y * Policy::STA_X + threadIdx.x;
ptr[idx] = impact;
if ( threadIdx.x >= 1) ptr [idx ] = (ptr [idx - 1] + ptr [idx]);
if ( threadIdx.x >= 2) ptr [idx ] = (ptr [idx - 2] + ptr [idx]);
if ( threadIdx.x >= 4) ptr [idx ] = (ptr [idx - 4] + ptr [idx]);
if ( threadIdx.x >= 8) ptr [idx ] = (ptr [idx - 8] + ptr [idx]);
if ( threadIdx.x >= 16) ptr [idx ] = (ptr [idx - 16] + ptr [idx]);
impact = ptr[idx];
#endif
confidence += impact;
if(__any((confidence <= stages[(st + threadIdx.x)]))) st += 2048;
}
...
...
modules/gpu/src/softcascade.cpp
View file @
08910e81
...
...
@@ -298,14 +298,14 @@ struct cv::gpu::SCascade::Fields
leaves
.
upload
(
hleaves
);
levels
.
upload
(
hlevels
);
invoker
=
device
::
icf
::
CascadeInvoker
<
device
::
icf
::
GK107PolicyX4
>
(
levels
,
octaves
,
stages
,
nodes
,
leaves
);
}
void
detect
(
int
scale
,
const
cv
::
gpu
::
GpuMat
&
roi
,
const
cv
::
gpu
::
GpuMat
&
count
,
cv
::
gpu
::
GpuMat
&
objects
,
const
cudaStream_t
&
stream
)
const
{
cudaMemset
(
count
.
data
,
0
,
sizeof
(
Detection
));
cudaSafeCall
(
cudaGetLastError
());
device
::
icf
::
CascadeInvoker
<
device
::
icf
::
GK107PolicyX4
>
invoker
=
device
::
icf
::
CascadeInvoker
<
device
::
icf
::
GK107PolicyX4
>
(
levels
,
octaves
,
stages
,
nodes
,
leaves
);
invoker
(
roi
,
hogluv
,
objects
,
count
,
downscales
,
scale
,
stream
);
}
...
...
@@ -407,8 +407,14 @@ private:
GpuMat
channels
(
plane
,
cv
::
Rect
(
0
,
0
,
fw
,
fh
*
Fields
::
HOG_LUV_BINS
));
cv
::
gpu
::
resize
(
channels
,
shrunk
,
cv
::
Size
(),
0.25
,
0.25
,
CV_INTER_AREA
,
s
);
cudaStream_t
stream
=
StreamAccessor
::
getStream
(
s
);
device
::
imgproc
::
shfl_integral_gpu_buffered
(
shrunk
,
integralBuffer
,
hogluv
,
12
,
stream
);
if
(
info
.
majorVersion
()
<
3
)
cv
::
gpu
::
integralBuffered
(
shrunk
,
hogluv
,
integralBuffer
,
s
);
else
{
cudaStream_t
stream
=
StreamAccessor
::
getStream
(
s
);
device
::
imgproc
::
shfl_integral_gpu_buffered
(
shrunk
,
integralBuffer
,
hogluv
,
12
,
stream
);
}
}
public
:
...
...
@@ -452,7 +458,7 @@ public:
GpuMat
sobelBuf
;
device
::
icf
::
CascadeInvoker
<
device
::
icf
::
GK107PolicyX4
>
invoker
;
DeviceInfo
info
;
enum
{
BOOST
=
0
};
enum
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment