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
57595a83
Commit
57595a83
authored
Aug 13, 2013
by
Roman Donchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Boring changes - gpu.
parent
0dcb4f1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
cascadeclassifier.cpp
modules/gpu/src/cascadeclassifier.cpp
+10
-10
No files found.
modules/gpu/src/cascadeclassifier.cpp
View file @
57595a83
...
...
@@ -207,8 +207,8 @@ private:
ncvAssertCUDAReturn
(
cudaGetDeviceProperties
(
&
devProp
,
devId
),
NCV_CUDA_ERROR
);
// Load the classifier from file (assuming its size is about 1 mb) using a simple allocator
gpuCascadeAllocator
=
new
NCVMemNativeAllocator
(
NCVMemoryTypeDevice
,
static_cast
<
int
>
(
devProp
.
textureAlignment
));
cpuCascadeAllocator
=
new
NCVMemNativeAllocator
(
NCVMemoryTypeHostPinned
,
static_cast
<
int
>
(
devProp
.
textureAlignment
));
gpuCascadeAllocator
=
makePtr
<
NCVMemNativeAllocator
>
(
NCVMemoryTypeDevice
,
static_cast
<
int
>
(
devProp
.
textureAlignment
));
cpuCascadeAllocator
=
makePtr
<
NCVMemNativeAllocator
>
(
NCVMemoryTypeHostPinned
,
static_cast
<
int
>
(
devProp
.
textureAlignment
));
ncvAssertPrintReturn
(
gpuCascadeAllocator
->
isInitialized
(),
"Error creating cascade GPU allocator"
,
NCV_CUDA_ERROR
);
ncvAssertPrintReturn
(
cpuCascadeAllocator
->
isInitialized
(),
"Error creating cascade CPU allocator"
,
NCV_CUDA_ERROR
);
...
...
@@ -217,9 +217,9 @@ private:
ncvStat
=
ncvHaarGetClassifierSize
(
classifierFile
,
haarNumStages
,
haarNumNodes
,
haarNumFeatures
);
ncvAssertPrintReturn
(
ncvStat
==
NCV_SUCCESS
,
"Error reading classifier size (check the file)"
,
NCV_FILE_ERROR
);
h_haarStages
=
new
NCVVectorAlloc
<
HaarStage64
>
(
*
cpuCascadeAllocator
,
haarNumStages
);
h_haarNodes
=
new
NCVVectorAlloc
<
HaarClassifierNode128
>
(
*
cpuCascadeAllocator
,
haarNumNodes
);
h_haarFeatures
=
new
NCVVectorAlloc
<
HaarFeature64
>
(
*
cpuCascadeAllocator
,
haarNumFeatures
);
h_haarStages
.
reset
(
new
NCVVectorAlloc
<
HaarStage64
>
(
*
cpuCascadeAllocator
,
haarNumStages
)
);
h_haarNodes
.
reset
(
new
NCVVectorAlloc
<
HaarClassifierNode128
>
(
*
cpuCascadeAllocator
,
haarNumNodes
)
);
h_haarFeatures
.
reset
(
new
NCVVectorAlloc
<
HaarFeature64
>
(
*
cpuCascadeAllocator
,
haarNumFeatures
)
);
ncvAssertPrintReturn
(
h_haarStages
->
isMemAllocated
(),
"Error in cascade CPU allocator"
,
NCV_CUDA_ERROR
);
ncvAssertPrintReturn
(
h_haarNodes
->
isMemAllocated
(),
"Error in cascade CPU allocator"
,
NCV_CUDA_ERROR
);
...
...
@@ -228,9 +228,9 @@ private:
ncvStat
=
ncvHaarLoadFromFile_host
(
classifierFile
,
haar
,
*
h_haarStages
,
*
h_haarNodes
,
*
h_haarFeatures
);
ncvAssertPrintReturn
(
ncvStat
==
NCV_SUCCESS
,
"Error loading classifier"
,
NCV_FILE_ERROR
);
d_haarStages
=
new
NCVVectorAlloc
<
HaarStage64
>
(
*
gpuCascadeAllocator
,
haarNumStages
);
d_haarNodes
=
new
NCVVectorAlloc
<
HaarClassifierNode128
>
(
*
gpuCascadeAllocator
,
haarNumNodes
);
d_haarFeatures
=
new
NCVVectorAlloc
<
HaarFeature64
>
(
*
gpuCascadeAllocator
,
haarNumFeatures
);
d_haarStages
.
reset
(
new
NCVVectorAlloc
<
HaarStage64
>
(
*
gpuCascadeAllocator
,
haarNumStages
)
);
d_haarNodes
.
reset
(
new
NCVVectorAlloc
<
HaarClassifierNode128
>
(
*
gpuCascadeAllocator
,
haarNumNodes
)
);
d_haarFeatures
.
reset
(
new
NCVVectorAlloc
<
HaarFeature64
>
(
*
gpuCascadeAllocator
,
haarNumFeatures
)
);
ncvAssertPrintReturn
(
d_haarStages
->
isMemAllocated
(),
"Error in cascade GPU allocator"
,
NCV_CUDA_ERROR
);
ncvAssertPrintReturn
(
d_haarNodes
->
isMemAllocated
(),
"Error in cascade GPU allocator"
,
NCV_CUDA_ERROR
);
...
...
@@ -279,8 +279,8 @@ private:
ncvAssertReturnNcvStat
(
ncvStat
);
ncvAssertCUDAReturn
(
cudaStreamSynchronize
(
0
),
NCV_CUDA_ERROR
);
gpuAllocator
=
new
NCVMemStackAllocator
(
NCVMemoryTypeDevice
,
gpuCounter
.
maxSize
(),
static_cast
<
int
>
(
devProp
.
textureAlignment
));
cpuAllocator
=
new
NCVMemStackAllocator
(
NCVMemoryTypeHostPinned
,
cpuCounter
.
maxSize
(),
static_cast
<
int
>
(
devProp
.
textureAlignment
));
gpuAllocator
=
makePtr
<
NCVMemStackAllocator
>
(
NCVMemoryTypeDevice
,
gpuCounter
.
maxSize
(),
static_cast
<
int
>
(
devProp
.
textureAlignment
));
cpuAllocator
=
makePtr
<
NCVMemStackAllocator
>
(
NCVMemoryTypeHostPinned
,
cpuCounter
.
maxSize
(),
static_cast
<
int
>
(
devProp
.
textureAlignment
));
ncvAssertPrintReturn
(
gpuAllocator
->
isInitialized
(),
"Error creating GPU memory allocator"
,
NCV_CUDA_ERROR
);
ncvAssertPrintReturn
(
cpuAllocator
->
isInitialized
(),
"Error creating CPU memory allocator"
,
NCV_CUDA_ERROR
);
...
...
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