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
656594ad
Commit
656594ad
authored
Apr 02, 2013
by
Andrey Kamaev
Committed by
OpenCV Buildbot
Apr 02, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #736 from bitwangyaoyao:2.4_clflush
parents
baa4882a
f3254b28
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
6 deletions
+18
-6
ocl.hpp
modules/ocl/include/opencv2/ocl/ocl.hpp
+3
-0
precomp.hpp
modules/ocl/perf/precomp.hpp
+2
-0
initialization.cpp
modules/ocl/src/initialization.cpp
+6
-1
mcwutil.cpp
modules/ocl/src/mcwutil.cpp
+7
-5
No files found.
modules/ocl/include/opencv2/ocl/ocl.hpp
View file @
656594ad
...
...
@@ -126,6 +126,9 @@ namespace cv
CV_EXPORTS
void
*
getoclCommandQueue
();
//explicit call clFinish. The global command queue will be used.
CV_EXPORTS
void
finish
();
//this function enable ocl module to use customized cl_context and cl_command_queue
//getDevice also need to be called before this function
CV_EXPORTS
void
setDeviceEx
(
Info
&
oclinfo
,
void
*
ctx
,
void
*
qu
,
int
devnum
=
0
);
...
...
modules/ocl/perf/precomp.hpp
View file @
656594ad
...
...
@@ -375,6 +375,7 @@ struct name##_test: Runnable { \
while (!TestSystem::instance().stop()) { \
TestSystem::instance().gpuOn()
#define GPU_OFF \
ocl::finish(); \
TestSystem::instance().gpuOff(); \
} TestSystem::instance().gpuComplete()
...
...
@@ -388,4 +389,5 @@ struct name##_test: Runnable { \
#define WARMUP_ON \
while (!TestSystem::instance().warmupStop()) {
#define WARMUP_OFF \
ocl::finish(); \
} TestSystem::instance().warmupComplete()
modules/ocl/src/initialization.cpp
View file @
656594ad
...
...
@@ -354,6 +354,11 @@ namespace cv
return
&
(
Context
::
getContext
()
->
impl
->
clCmdQueue
);
}
void
finish
()
{
clFinish
(
Context
::
getContext
()
->
impl
->
clCmdQueue
);
}
void
queryDeviceInfo
(
DEVICE_INFO
info_type
,
void
*
info
)
{
static
Info
::
Impl
*
impl
=
Context
::
getContext
()
->
impl
;
...
...
@@ -712,7 +717,7 @@ namespace cv
clReleaseEvent
(
event
);
#endif
clF
ini
sh
(
clCxt
->
impl
->
clCmdQueue
);
clF
lu
sh
(
clCxt
->
impl
->
clCmdQueue
);
openCLSafeCall
(
clReleaseKernel
(
kernel
));
}
...
...
modules/ocl/src/mcwutil.cpp
View file @
656594ad
...
...
@@ -144,7 +144,7 @@ namespace cv
format
.
image_channel_data_type
=
CL_FLOAT
;
break
;
default
:
throw
std
::
exception
(
);
CV_Error
(
-
1
,
"Image forma is not supported"
);
break
;
}
switch
(
channels
)
...
...
@@ -159,7 +159,7 @@ namespace cv
format
.
image_channel_order
=
CL_RGBA
;
break
;
default
:
throw
std
::
exception
(
);
CV_Error
(
-
1
,
"Image forma is not supported"
);
break
;
}
#if CL_VERSION_1_2
...
...
@@ -197,7 +197,8 @@ namespace cv
const
size_t
regin
[
3
]
=
{
mat
.
cols
*
mat
.
elemSize
(),
mat
.
rows
,
1
};
clEnqueueCopyBufferRect
((
cl_command_queue
)
mat
.
clCxt
->
oclCommandQueue
(),
(
cl_mem
)
mat
.
data
,
devData
,
origin
,
origin
,
regin
,
mat
.
step
,
0
,
mat
.
cols
*
mat
.
elemSize
(),
0
,
0
,
NULL
,
NULL
);
}
clFlush
((
cl_command_queue
)
mat
.
clCxt
->
oclCommandQueue
());
}
else
{
devData
=
(
cl_mem
)
mat
.
data
;
...
...
@@ -206,7 +207,7 @@ namespace cv
clEnqueueCopyBufferToImage
((
cl_command_queue
)
mat
.
clCxt
->
oclCommandQueue
(),
devData
,
texture
,
0
,
origin
,
region
,
0
,
NULL
,
0
);
if
((
mat
.
cols
*
mat
.
elemSize
()
!=
mat
.
step
))
{
clF
ini
sh
((
cl_command_queue
)
mat
.
clCxt
->
oclCommandQueue
());
clF
lu
sh
((
cl_command_queue
)
mat
.
clCxt
->
oclCommandQueue
());
clReleaseMemObject
(
devData
);
}
...
...
@@ -231,7 +232,8 @@ namespace cv
try
{
cv
::
ocl
::
openCLGetKernelFromSource
(
clCxt
,
&
_kernel_string
,
"test_func"
);
//_support = true;
finish
();
_support
=
true
;
}
catch
(
const
cv
::
Exception
&
e
)
{
...
...
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