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
6b7d890f
Commit
6b7d890f
authored
Dec 20, 2013
by
Andrey Pavlenko
Committed by
OpenCV Buildbot
Dec 20, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2014 from krodyush:pullreq/2.4-opt-131211-surf
parents
b633c73c
fffac2f0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
surf.cl
modules/nonfree/src/opencl/surf.cl
+0
-0
surf.ocl.cpp
modules/nonfree/src/surf.ocl.cpp
+15
-7
No files found.
modules/nonfree/src/opencl/surf.cl
View file @
6b7d890f
This diff is collapsed.
Click to expand it.
modules/nonfree/src/surf.ocl.cpp
View file @
6b7d890f
...
...
@@ -46,6 +46,7 @@
#ifdef HAVE_OPENCV_OCL
#include <cstdio>
#include <sstream>
#include "opencl_kernels.hpp"
using
namespace
cv
;
...
...
@@ -55,18 +56,25 @@ namespace cv
{
namespace
ocl
{
// The number of degrees between orientation samples in calcOrientation
const
static
int
ORI_SEARCH_INC
=
5
;
// The local size of the calcOrientation kernel
const
static
int
ORI_LOCAL_SIZE
=
(
360
/
ORI_SEARCH_INC
);
static
void
openCLExecuteKernelSURF
(
Context
*
clCxt
,
const
cv
::
ocl
::
ProgramEntry
*
source
,
string
kernelName
,
size_t
globalThreads
[
3
],
size_t
localThreads
[
3
],
std
::
vector
<
std
::
pair
<
size_t
,
const
void
*>
>
&
args
,
int
channels
,
int
depth
)
{
char
optBuf
[
100
]
=
{
0
};
char
*
optBufPtr
=
optBuf
;
std
::
stringstream
optsStr
;
optsStr
<<
"-D ORI_LOCAL_SIZE="
<<
ORI_LOCAL_SIZE
<<
" "
;
optsStr
<<
"-D ORI_SEARCH_INC="
<<
ORI_SEARCH_INC
<<
" "
;
cl_kernel
kernel
;
kernel
=
openCLGetKernelFromSource
(
clCxt
,
source
,
kernelName
,
opt
BufPtr
);
kernel
=
openCLGetKernelFromSource
(
clCxt
,
source
,
kernelName
,
opt
sStr
.
str
().
c_str
()
);
size_t
wave_size
=
queryWaveFrontSize
(
kernel
);
CV_Assert
(
clReleaseKernel
(
kernel
)
==
CL_SUCCESS
);
sprintf
(
optBufPtr
,
"-D WAVE_SIZE=%d"
,
static_cast
<
int
>
(
wave_size
))
;
openCLExecuteKernel
(
clCxt
,
source
,
kernelName
,
globalThreads
,
localThreads
,
args
,
channels
,
depth
,
opt
BufPtr
);
optsStr
<<
"-D WAVE_SIZE="
<<
wave_size
;
openCLExecuteKernel
(
clCxt
,
source
,
kernelName
,
globalThreads
,
localThreads
,
args
,
channels
,
depth
,
opt
sStr
.
str
().
c_str
()
);
}
}
}
...
...
@@ -594,8 +602,8 @@ void SURF_OCL_Invoker::icvCalcOrientation_gpu(const oclMat &keypoints, int nFeat
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_int
),
(
void
*
)
&
img_cols
));
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_int
),
(
void
*
)
&
surf_
.
sum
.
step
));
size_t
localThreads
[
3
]
=
{
32
,
4
,
1
};
size_t
globalThreads
[
3
]
=
{
nFeatures
*
localThreads
[
0
],
localThreads
[
1
]
,
1
};
size_t
localThreads
[
3
]
=
{
ORI_LOCAL_SIZE
,
1
,
1
};
size_t
globalThreads
[
3
]
=
{
nFeatures
*
localThreads
[
0
],
1
,
1
};
openCLExecuteKernelSURF
(
clCxt
,
&
surf
,
kernelName
,
globalThreads
,
localThreads
,
args
,
-
1
,
-
1
);
}
...
...
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