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
5022bc8c
Commit
5022bc8c
authored
Apr 05, 2013
by
yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move the "cpu device checking" from supportsFeatures() to queryDeviceInfo()
parent
d5aaea27
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
10 deletions
+16
-10
ocl.hpp
modules/ocl/include/opencv2/ocl/ocl.hpp
+1
-1
util.hpp
modules/ocl/include/opencv2/ocl/private/util.hpp
+3
-2
initialization.cpp
modules/ocl/src/initialization.cpp
+9
-6
pyrlk.cpp
modules/ocl/src/pyrlk.cpp
+3
-1
No files found.
modules/ocl/include/opencv2/ocl/ocl.hpp
View file @
5022bc8c
...
...
@@ -155,7 +155,7 @@ namespace cv
static
Context
*
getContext
();
static
void
setContext
(
Info
&
oclinfo
);
enum
{
CL_DOUBLE
,
CL_UNIFIED_MEM
,
CL_CPU
};
enum
{
CL_DOUBLE
,
CL_UNIFIED_MEM
};
bool
supportsFeature
(
int
ftype
);
size_t
computeUnits
();
void
*
oclContext
();
...
...
modules/ocl/include/opencv2/ocl/private/util.hpp
View file @
5022bc8c
...
...
@@ -127,8 +127,9 @@ namespace cv
// currently only support wavefront size queries
enum
DEVICE_INFO
{
WAVEFRONT_SIZE
,
//in AMD speak
WARP_SIZE
=
WAVEFRONT_SIZE
//in nvidia speak
WAVEFRONT_SIZE
,
//in AMD speak
WARP_SIZE
=
WAVEFRONT_SIZE
,
//in nvidia speak
IS_CPU_DEVICE
//check if the device is CPU
};
//info should have been pre-allocated
void
CV_EXPORTS
queryDeviceInfo
(
DEVICE_INFO
info_type
,
void
*
info
);
...
...
modules/ocl/src/initialization.cpp
View file @
5022bc8c
...
...
@@ -397,6 +397,15 @@ namespace cv
}
break
;
case
IS_CPU_DEVICE
:
{
cl_device_type
devicetype
;
openCLSafeCall
(
clGetDeviceInfo
(
impl
->
devices
[
impl
->
devnum
],
CL_DEVICE_TYPE
,
sizeof
(
cl_device_type
),
&
devicetype
,
NULL
));
*
(
bool
*
)
info
=
(
devicetype
==
CVCL_DEVICE_TYPE_CPU
);
}
break
;
default
:
CV_Error
(
-
1
,
"Invalid device info type"
);
break
;
...
...
@@ -979,12 +988,6 @@ namespace cv
return
impl
->
double_support
==
1
;
case
CL_UNIFIED_MEM
:
return
impl
->
unified_memory
==
1
;
case
CL_CPU
:
cl_device_type
devicetype
;
clGetDeviceInfo
(
impl
->
devices
[
impl
->
devnum
],
CL_DEVICE_TYPE
,
sizeof
(
cl_device_type
),
&
devicetype
,
NULL
);
return
devicetype
==
CVCL_DEVICE_TYPE_CPU
;
default
:
return
false
;
}
...
...
modules/ocl/src/pyrlk.cpp
View file @
5022bc8c
...
...
@@ -187,7 +187,9 @@ static void lkSparse_run(oclMat &I, oclMat &J,
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
),
(
void
*
)
&
iters
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_char
),
(
void
*
)
&
calcErr
));
if
(
clCxt
->
supportsFeature
(
Context
::
CL_CPU
))
bool
is_cpu
;
queryDeviceInfo
(
IS_CPU_DEVICE
,
&
is_cpu
);
if
(
is_cpu
)
{
openCLExecuteKernel
(
clCxt
,
&
pyrlk
,
kernelName
,
globalThreads
,
localThreads
,
args
,
I
.
oclchannels
(),
I
.
depth
(),
(
char
*
)
" -D CPU"
);
releaseTexture
(
ITex
);
...
...
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