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
da47ccec
Commit
da47ccec
authored
Feb 27, 2013
by
yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put the cl_image support detection in utils
parent
ea433cc4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
30 deletions
+34
-30
mcwutil.cpp
modules/ocl/src/mcwutil.cpp
+30
-0
mcwutil.hpp
modules/ocl/src/mcwutil.hpp
+4
-0
surf.cpp
modules/ocl/src/surf.cpp
+0
-30
No files found.
modules/ocl/src/mcwutil.cpp
View file @
da47ccec
...
...
@@ -221,6 +221,36 @@ namespace cv
{
openCLFree
(
texture
);
}
bool
support_image2d
(
Context
*
clCxt
)
{
static
const
char
*
_kernel_string
=
"__kernel void test_func(image2d_t img) {}"
;
static
bool
_isTested
=
false
;
static
bool
_support
=
false
;
if
(
_isTested
)
{
return
_support
;
}
try
{
cv
::
ocl
::
openCLGetKernelFromSource
(
clCxt
,
&
_kernel_string
,
"test_func"
);
_support
=
true
;
}
catch
(
const
cv
::
Exception
&
e
)
{
if
(
e
.
code
==
-
217
)
{
_support
=
false
;
}
else
{
// throw e once again
throw
e
;
}
}
_isTested
=
true
;
return
_support
;
}
}
//namespace ocl
}
//namespace cv
...
...
modules/ocl/src/mcwutil.hpp
View file @
da47ccec
...
...
@@ -70,6 +70,10 @@ namespace cv
// 2. for faster clamping, there is no buffer padding for the constructed texture
cl_mem
bindTexture
(
const
oclMat
&
mat
);
void
releaseTexture
(
cl_mem
&
texture
);
// returns whether the current context supports image2d_t format or not
bool
support_image2d
(
Context
*
clCxt
=
Context
::
getContext
());
}
//namespace ocl
}
//namespace cv
...
...
modules/ocl/src/surf.cpp
View file @
da47ccec
...
...
@@ -83,36 +83,6 @@ static inline int calcSize(int octave, int layer)
namespace
{
const
char
*
noImage2dOption
=
"-D DISABLE_IMAGE2D"
;
// default kernel name can be any kernel in nonfree_surf.cl
bool
support_image2d
(
const
char
*
kernel_name
=
"icvCalcLayerDetAndTrace"
)
{
static
bool
_isTested
=
false
;
static
bool
_support
=
false
;
if
(
_isTested
)
{
return
_support
;
}
try
{
cv
::
ocl
::
openCLGetKernelFromSource
(
Context
::
getContext
(),
&
nonfree_surf
,
kernel_name
);
_support
=
true
;
}
catch
(
cv
::
Exception
&
e
)
{
if
(
e
.
code
==
-
217
)
{
_support
=
false
;
}
else
{
// throw e once again
cv
::
error
(
e
);
}
}
_isTested
=
true
;
return
_support
;
}
}
class
SURF_OCL_Invoker
...
...
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